From 4d04f91c838a6f0421cbf48a4e926efb26d2d17b Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Tue, 20 Jun 2017 20:26:04 +0200 Subject: [PATCH] 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 --- includes/title/MalformedTitleException.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1