EditPage::getBaseRevision can return null. (fix phpdoc)
authoraddshore <addshorewiki@gmail.com>
Thu, 15 Feb 2018 10:08:20 +0000 (10:08 +0000)
committeraddshore <addshorewiki@gmail.com>
Thu, 15 Feb 2018 10:08:20 +0000 (10:08 +0000)
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

index 6fbeed7..7fbc747 100644 (file)
@@ -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 ) {