X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fpage%2FArticle.php;h=e90334fce6a69ce3b2c95bc650fbabfb4bf4490e;hb=fede766fe9950e3a036c263bf17d19d31278221c;hp=49912c77ddf3cc220dbb08100bb6ffadefb35fee;hpb=b824b6c052b6a22d7505496c5324c3d906adc5ee;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/Article.php b/includes/page/Article.php index 49912c77dd..e90334fce6 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -33,23 +33,30 @@ use MediaWiki\MediaWikiServices; * moved to separate EditPage and HTMLFileCache classes. */ class Article implements Page { - /** @var IContextSource The context this Article is executed in */ + /** + * @var IContextSource|null The context this Article is executed in. + * If null, REquestContext::getMain() is used. + */ protected $mContext; /** @var WikiPage The WikiPage object of this instance */ protected $mPage; - /** @var ParserOptions ParserOptions object for $wgUser articles */ + /** + * @var ParserOptions|null ParserOptions object for $wgUser articles. + * Initialized by getParserOptions by calling $this->mPage->makeParserOptions(). + */ public $mParserOptions; /** - * @var string Text of the revision we are working on + * @var string|null Text of the revision we are working on * @todo BC cruft */ public $mContent; /** - * @var Content Content of the revision we are working on + * @var Content|null Content of the revision we are working on. + * Initialized by fetchContentObject(). * @since 1.21 */ public $mContentObject; @@ -60,7 +67,7 @@ class Article implements Page { /** @var int|null The oldid of the article that is to be shown, 0 for the current revision */ public $mOldId; - /** @var Title Title from which we were redirected here */ + /** @var Title|null Title from which we were redirected here, if any. */ public $mRedirectedFrom = null; /** @var string|bool URL to redirect to or false if none */ @@ -69,10 +76,16 @@ class Article implements Page { /** @var int Revision ID of revision we are working on */ public $mRevIdFetched = 0; - /** @var Revision Revision we are working on */ + /** + * @var Revision|null Revision we are working on. Initialized by getOldIDFromRequest() + * or fetchContentObject(). + */ public $mRevision = null; - /** @var ParserOutput */ + /** + * @var ParserOutput|null|false The ParserOutput generated for viewing the page, + * initialized by view(). If no ParserOutput could be generated, this is set to false. + */ public $mParserOutput; /** @@ -641,7 +654,7 @@ class Article implements Page { # Note that $this->mParserOutput is the *current*/oldid version output. $pOutput = ( $outputDone instanceof ParserOutput ) ? $outputDone // object fetched by hook - : $this->mParserOutput; + : $this->mParserOutput ?: null; // ParserOutput or null, avoid false # Adjust title for main page & pages with displaytitle if ( $pOutput ) { @@ -750,7 +763,7 @@ class Article implements Page { * @return array The policy that should be set * @todo actions other than 'view' */ - public function getRobotPolicy( $action, $pOutput = null ) { + public function getRobotPolicy( $action, ParserOutput $pOutput = null ) { global $wgArticleRobotPolicies, $wgNamespaceRobotPolicies, $wgDefaultRobotPolicy; $ns = $this->getTitle()->getNamespace();