message = $message; $this->code = $code; $this->arguments = $arguments; $this->title = $title; } /** * Returns the error message * * @return string The error message */ public function getMessage(): string { return $this->message; } /** * Returns the error code * * @return int The error code */ public function getCode(): int { return $this->code; } /** * Get arguments */ public function getArguments(): array { return $this->arguments; } /** * Get title */ public function getTitle(): string { return $this->title; } /** * Return the rendered message */ public function render(): string { if (count($this->arguments) > 0) { return vsprintf($this->message, $this->arguments); } return $this->message; } /** * Converts this error into a string * * @return string */ public function __toString() { return $this->render(); } }