diff --git a/lib/public/HintException.php b/lib/public/HintException.php index 6d9684bddeab0..9dcba50674118 100644 --- a/lib/public/HintException.php +++ b/lib/public/HintException.php @@ -1,5 +1,7 @@ hint = $hint; + public function __construct( + string $message, + private string $hint = '', + int $code = 0, + ?\Exception $previous = null, + ) { parent::__construct($message, $code, $previous); } @@ -40,7 +40,6 @@ public function __construct($message, $hint = '', $code = 0, ?\Exception $previo * code, the message and the hint. * * @since 23.0.0 - * @return string */ public function __toString(): string { return self::class . ": [{$this->code}]: {$this->message} ({$this->hint})\n"; @@ -52,12 +51,8 @@ public function __toString(): string { * instead. * * @since 23.0.0 - * @return string */ public function getHint(): string { - if (empty($this->hint)) { - return $this->message; - } - return $this->hint; + return $this->hint !== '' ? $this->hint : $this->message; } }