From: addshore Date: Thu, 15 Feb 2018 10:08:20 +0000 (+0000) Subject: EditPage::getBaseRevision can return null. (fix phpdoc) X-Git-Tag: 1.31.0-rc.0~603^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=9f62f0a1d54902f9a5ed0de1fc3a39e17a3143f5;p=lhc%2Fweb%2Fwiklou.git EditPage::getBaseRevision can return null. (fix phpdoc) If !$this->mBaseRevision then the code to populte $this->mBaseRevision is run. This code either calls Revision::newFromId or Revision::loadFromTimestamp both of which are documented as being able to return null. As a result EditPage::getBaseRevision can alos return null. Bug: T187378 Change-Id: I60ad9ddcfbe6e1060cab1ad6aa2194c1a3406cbf --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 6fbeed7b4d..7fbc747ba7 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -325,7 +325,7 @@ class EditPage { /** @var bool Has a summary been preset using GET parameter &summary= ? */ public $hasPresetSummary = false; - /** @var Revision|bool */ + /** @var Revision|bool|null */ public $mBaseRevision = false; /** @var bool */ @@ -2369,7 +2369,7 @@ ERROR; /** * @note: this method is very poorly named. If the user opened the form with ?oldid=X, * one might think of X as the "base revision", which is NOT what this returns. - * @return Revision Current version when the edit was started + * @return Revision|null Current version when the edit was started */ public function getBaseRevision() { if ( !$this->mBaseRevision ) {