SpecialRunJobs: optional output stats and status.
[lhc/web/wiklou.git] / includes / Title.php
index eb19076..547b28c 100644 (file)
@@ -178,8 +178,8 @@ class Title implements LinkTarget, IDBAccessObject {
        /** @var bool Whether a page has any subpages */
        private $mHasSubpages;
 
-       /** @var bool The (string) language code of the page's language and content code. */
-       private $mPageLanguage = false;
+       /** @var array|null The (string) language code of the page's language and content code. */
+       private $mPageLanguage;
 
        /** @var string|bool|null The page language code from the database, null if not saved in
         * the database or false if not loaded, yet.
@@ -1250,6 +1250,7 @@ class Title implements LinkTarget, IDBAccessObject {
         * @param int|int[] $namespaces,... The namespaces to check for
         * @return bool
         * @since 1.19
+        * @suppress PhanCommentParamOnEmptyParamList Cannot make variadic due to HHVM bug, T191668#5263929
         */
        public function inNamespaces( /* ... */ ) {
                $namespaces = func_get_args();
@@ -2499,6 +2500,7 @@ class Title implements LinkTarget, IDBAccessObject {
         * Determines if $user is unable to edit this page because it has been protected
         * by $wgNamespaceProtection.
         *
+        * @deprecated since 1.34 Don't use this function in new code.
         * @param User $user User object to check permissions
         * @return bool
         */
@@ -2953,7 +2955,7 @@ class Title implements LinkTarget, IDBAccessObject {
                }
 
                $dbr = wfGetDB( DB_REPLICA );
-               $conds['page_namespace'] = $this->mNamespace;
+               $conds = [ 'page_namespace' => $this->mNamespace ];
                $conds[] = 'page_title ' . $dbr->buildLike( $this->mDbkeyform . '/', $dbr->anyString() );
                $options = [];
                if ( $limit > -1 ) {
@@ -3161,7 +3163,7 @@ class Title implements LinkTarget, IDBAccessObject {
                $this->mLatestID = false;
                $this->mContentModel = false;
                $this->mEstimateRevisions = null;
-               $this->mPageLanguage = false;
+               $this->mPageLanguage = null;
                $this->mDbPageLanguage = false;
                $this->mIsBigDeletion = null;
        }
@@ -3210,6 +3212,7 @@ class Title implements LinkTarget, IDBAccessObject {
                //        splitTitleString method, but the only implementation (MediaWikiTitleCodec) does
                /** @var MediaWikiTitleCodec $titleCodec */
                $titleCodec = MediaWikiServices::getInstance()->getTitleParser();
+               '@phan-var MediaWikiTitleCodec $titleCodec';
                // MalformedTitleException can be thrown here
                $parts = $titleCodec->splitTitleString( $this->mDbkeyform, $this->mDefaultNamespace );
 
@@ -3530,7 +3533,7 @@ class Title implements LinkTarget, IDBAccessObject {
                $method = $auth ? 'moveSubpagesIfAllowed' : 'moveSubpages';
                $result = $mp->$method( $wgUser, $reason, $createRedirect, $changeTags );
 
-               if ( !$result->isOk() ) {
+               if ( !$result->isOK() ) {
                        return $result->getErrorsArray();
                }