From: Lucas Werkmeister Date: Tue, 20 Jun 2017 18:26:04 +0000 (+0200) Subject: Make MalformedTitleException errorMessage non-null X-Git-Tag: 1.31.0-rc.0~2933^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=4d04f91c838a6f0421cbf48a4e926efb26d2d17b Make MalformedTitleException errorMessage non-null A null $errorMessage constructor argument has not been supported since I43d988602b, since wfMessage (via the Message constructor) throws an exception if the message key is null. It follows that getErrorMessage() can never return null. Bug: T99818 Change-Id: I2cbf4909e7237b0a91d100cc5478fb4cfee1d748 --- diff --git a/includes/title/MalformedTitleException.php b/includes/title/MalformedTitleException.php index 2dddac5c2c..213343f968 100644 --- a/includes/title/MalformedTitleException.php +++ b/includes/title/MalformedTitleException.php @@ -34,7 +34,7 @@ class MalformedTitleException extends Exception implements ILocalizedException { * $titleText will be appended if it's not null. (since MW 1.26) */ public function __construct( - $errorMessage = null, $titleText = null, $errorMessageParameters = [] + $errorMessage, $titleText = null, $errorMessageParameters = [] ) { $this->errorMessage = $errorMessage; $this->titleText = $titleText; @@ -59,7 +59,7 @@ class MalformedTitleException extends Exception implements ILocalizedException { /** * @since 1.26 - * @return string|null + * @return string */ public function getErrorMessage() { return $this->errorMessage;