isError = $isError; $this->message = $message; } /** * @return bool */ public function isError(): bool { return $this->isError; } /** * @return string */ public function getMessage(): string { return $this->message; } /** * @return array */ public function toArray(): array { return [ 'error' => $this->isError, 'message' => $this->message, ]; } }