From 9f62f0a1d54902f9a5ed0de1fc3a39e17a3143f5 Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 15 Feb 2018 10:08:20 +0000 Subject: [PATCH] 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 --- includes/EditPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ) { -- 2.20.1