userMessage = $userMessage; } function isError(): bool { return $this->getCode() !== 0; } /** @var ?string */ protected $userMessage; function haveMessage(): bool { return $this->userMessage !== null; } function getUserMessage(): ?string { return $this->userMessage; } }