X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=3aa2c69ffa7ec36149f044d296766ad24c5a6762;hp=ae77c4ef03c7f684e23d939b95abc89ff301b5d7;hb=ba76dfdd050b83eb124ef2f12a6f22c467133fca;hpb=9ddd146c262806e993ea66994f367a0a795e762d diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ae77c4ef03..3aa2c69ffa 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -228,7 +228,11 @@ class Parser { public $mOptions; /** - * @var Title|null Beware - this is not always set + * Since 1.34, leaving `mTitle` uninitialized or setting `mTitle` to + * `null` is deprecated. + * + * @internal + * @var Title|null */ public $mTitle; # Title context, used for self-link rendering and similar things public $mOutputType; # Output type, one of the OT_xxx constants @@ -924,9 +928,14 @@ class Parser { /** * Accessor for the Title object * + * Since 1.34, leaving `mTitle` uninitialized as `null` is deprecated. + * * @return Title|null */ public function getTitle() : ?Title { + if ( $this->mTitle === null ) { + wfDeprecated( 'Parser title should never be null', '1.34' ); + } return $this->mTitle; }