success; } public function getMessage(): ?string { return $this->message; } public function getError(): ?string { return $this->error; } public static function success(string $message): self { return new self(true, $message, null); } public static function failure(string $error): self { return new self(false, null, $error); } public function toArray(): array { return [ 'success' => $this->success, 'message' => $this->message, 'error' => $this->error ]; } }