jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/325881 )

Change subject: Cleanup some incorrect return annotations
......................................................................


Cleanup some incorrect return annotations

Most of these are simply changing annotations to reflect
reality. If a function can return false to indicate failure
the @return should indicate it.

Some are fixing preg_match calls, preg match returns 1, 0 or false,
but the functions all claim to return booleans.

This is far from all the incorrect return types in mediawiki, there
are around 250 detected by phan, but have to start somewhere.

Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
---
M includes/Category.php
M includes/EditPage.php
M includes/GitInfo.php
M includes/GlobalFunctions.php
M includes/HistoryBlob.php
M includes/OutputPage.php
M includes/PathRouter.php
M includes/ProtectionForm.php
M includes/Revision.php
M includes/SiteConfiguration.php
M includes/Title.php
M includes/WebRequest.php
M includes/WikiMap.php
M includes/api/ApiBase.php
M includes/api/ApiParamInfo.php
M includes/api/ApiQueryBase.php
M includes/api/ApiQueryCategoryMembers.php
M includes/api/ApiStashEdit.php
M includes/cache/FileCacheBase.php
M includes/cache/localisation/LocalisationCache.php
M includes/db/DatabaseMssql.php
M includes/db/DatabaseOracle.php
M includes/debug/logger/LegacyLogger.php
M includes/diff/DairikiDiff.php
M includes/diff/DifferenceEngine.php
M includes/filerepo/FileRepo.php
M includes/filerepo/ForeignAPIRepo.php
M includes/filerepo/RepoGroup.php
M includes/filerepo/file/ArchivedFile.php
M includes/filerepo/file/File.php
M includes/filerepo/file/ForeignDBFile.php
M includes/htmlform/HTMLFormField.php
M includes/htmlform/fields/HTMLButtonField.php
M includes/htmlform/fields/HTMLMultiSelectField.php
M includes/htmlform/fields/HTMLSizeFilterField.php
M includes/http/Http.php
M includes/installer/Installer.php
M includes/installer/LocalSettingsGenerator.php
M includes/interwiki/ClassicInterwikiLookup.php
M includes/jobqueue/aggregator/JobQueueAggregatorRedis.php
M includes/libs/ExplodeIterator.php
M includes/libs/HashRing.php
M includes/libs/filebackend/FileBackendStore.php
M includes/libs/filebackend/SwiftFileBackend.php
M languages/Language.php
45 files changed, 62 insertions(+), 62 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Category.php b/includes/Category.php
index 1ebd605..d558dbc 100644
--- a/includes/Category.php
+++ b/includes/Category.php
@@ -168,7 +168,7 @@
         * @param Title $title Optional title object for the category 
represented by
         *   the given row. May be provided if it is already known, to avoid 
having
         *   to re-create a title object later.
-        * @return Category
+        * @return Category|false
         */
        public static function newFromRow( $row, $title = null ) {
                $cat = new self();
diff --git a/includes/EditPage.php b/includes/EditPage.php
index f37ce34..7a0a11f 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -295,7 +295,7 @@
        /** @var bool Has a summary been preset using GET parameter &summary= ? 
*/
        public $hasPresetSummary = false;
 
-       /** @var bool */
+       /** @var Revision|bool */
        public $mBaseRevision = false;
 
        /** @var bool */
diff --git a/includes/GitInfo.php b/includes/GitInfo.php
index de7e8c2..4351acc 100644
--- a/includes/GitInfo.php
+++ b/includes/GitInfo.php
@@ -46,7 +46,7 @@
        protected $cache = [];
 
        /**
-        * Map of repo URLs to viewer URLs. Access via static method 
getViewers().
+        * @var array|false Map of repo URLs to viewer URLs. Access via static 
method getViewers().
         */
        private static $viewers = false;
 
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index b3ccc56..4d27f68 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -545,7 +545,7 @@
  * @param string $url Either fully-qualified or a local path + query
  * @param string $defaultProto One of the PROTO_* constants. Determines the
  *    protocol to use if $url or $wgServer is protocol-relative
- * @return string Fully-qualified URL, current-path-relative URL or false if
+ * @return string|false Fully-qualified URL, current-path-relative URL or 
false if
  *    no valid URL can be constructed
  */
 function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) {
diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php
index b17a2f5..3d86201 100644
--- a/includes/HistoryBlob.php
+++ b/includes/HistoryBlob.php
@@ -239,7 +239,7 @@
        }
 
        /**
-        * @return string
+        * @return string|false
         */
        function getText() {
                if ( isset( self::$blobCache[$this->mOldId] ) ) {
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index bae871e..1d536bb 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2176,7 +2176,7 @@
         * if there isn't one. This is used by Skin to determine whether to 
enable
         * JavaScript frame-breaking, for clients that don't support 
X-Frame-Options.
         *
-        * @return string
+        * @return string|false
         */
        public function getFrameOptions() {
                $config = $this->getConfig();
diff --git a/includes/PathRouter.php b/includes/PathRouter.php
index 049b32f..cc6fc4a 100644
--- a/includes/PathRouter.php
+++ b/includes/PathRouter.php
@@ -364,7 +364,7 @@
         * difference between a $1 that was not replaced and a $1 that was part 
of
         * the content a $1 was replaced with.
         * @param string $value
-        * @return string
+        * @return string|false
         */
        public function replace( $value ) {
                $this->error = false;
diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php
index 451635e..454ffcc 100644
--- a/includes/ProtectionForm.php
+++ b/includes/ProtectionForm.php
@@ -148,7 +148,7 @@
         *
         * @param string $action
         *
-        * @return string 14-char timestamp or "infinity", or false if the 
input was invalid
+        * @return string|false 14-char timestamp or "infinity", or false if 
the input was invalid
         */
        function getExpiry( $action ) {
                if ( $this->mExpirySelection[$action] == 'existing' ) {
diff --git a/includes/Revision.php b/includes/Revision.php
index b812191..a74501f 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -874,7 +874,7 @@
        /**
         * Fetch revision's user id without regard for the current user's 
permissions
         *
-        * @return string
+        * @return int
         * @deprecated since 1.25, use getUser( Revision::RAW )
         */
        public function getRawUser() {
@@ -1269,7 +1269,7 @@
         *   (same as the the wiki $row was loaded from) or false to indicate 
the local
         *   wiki (this is the default). Otherwise, it must be a symbolic wiki 
database
         *   identifier as understood by the LoadBalancer class.
-        * @return string Text the text requested or false on failure
+        * @return string|false Text the text requested or false on failure
         */
        public static function getRevisionText( $row, $prefix = 'old_', $wiki = 
false ) {
 
diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php
index 885f926..8d9256b 100644
--- a/includes/SiteConfiguration.php
+++ b/includes/SiteConfiguration.php
@@ -274,7 +274,7 @@
         * @param string $from
         * @param string $to
         * @param string|array $in
-        * @return string
+        * @return string|array
         */
        function doReplace( $from, $to, $in ) {
                if ( is_string( $in ) ) {
diff --git a/includes/Title.php b/includes/Title.php
index 3c51bae..1507a0d 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -835,7 +835,7 @@
        /**
         * Returns the DB name of the distant wiki which owns the object.
         *
-        * @return string The DB name
+        * @return string|false The DB name
         */
        public function getTransWikiID() {
                if ( !$this->isExternal() ) {
@@ -974,7 +974,7 @@
        /**
         * Get the namespace text
         *
-        * @return string Namespace text
+        * @return string|false Namespace text
         */
        public function getNsText() {
                if ( $this->isExternal() ) {
@@ -4436,7 +4436,7 @@
         * Get the last touched timestamp
         *
         * @param IDatabase $db Optional db
-        * @return string Last-touched timestamp
+        * @return string|false Last-touched timestamp
         */
        public function getTouched( $db = null ) {
                if ( $db === null ) {
diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index 3ef3bc1..ecc5caa 100644
--- a/includes/WebRequest.php
+++ b/includes/WebRequest.php
@@ -238,7 +238,7 @@
         * This is for use prior to Setup.php, when no WebRequest object is 
available.
         * At other times, use the non-static function getProtocol().
         *
-        * @return array
+        * @return string
         */
        public static function detectProtocol() {
                if ( ( !empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 
'off' ) ||
diff --git a/includes/WikiMap.php b/includes/WikiMap.php
index 37f85ea..f7b8d2f 100644
--- a/includes/WikiMap.php
+++ b/includes/WikiMap.php
@@ -141,7 +141,7 @@
         * @param string $wikiID Wiki'd id (generally database name)
         * @param string $page Page name (must be normalised before calling 
this function!)
         * @param string $text Link's text; optional, default to $page
-        * @return string HTML link or false if the wiki was not found
+        * @return string|false HTML link or false if the wiki was not found
         */
        public static function makeForeignLink( $wikiID, $page, $text = null ) {
                if ( !$text ) {
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index a40593f..68acb52 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -2229,7 +2229,7 @@
         * "apihelp-{$this->getModulePath()}-description".
         *
         * @deprecated since 1.25
-        * @return Message|string|array
+        * @return Message|string|array|false
         */
        protected function getDescription() {
                return false;
diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php
index a9b3dde..46ba34b 100644
--- a/includes/api/ApiParamInfo.php
+++ b/includes/api/ApiParamInfo.php
@@ -237,7 +237,7 @@
 
        /**
         * @param ApiBase $module
-        * @return ApiResult
+        * @return array
         */
        private function getModuleInfo( $module ) {
                $ret = [];
diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php
index af2aed5..281fb61 100644
--- a/includes/api/ApiQueryBase.php
+++ b/includes/api/ApiQueryBase.php
@@ -584,7 +584,7 @@
         * @return bool
         */
        public function validateSha1Hash( $hash ) {
-               return preg_match( '/^[a-f0-9]{40}$/', $hash );
+               return (bool)preg_match( '/^[a-f0-9]{40}$/', $hash );
        }
 
        /**
@@ -592,7 +592,7 @@
         * @return bool
         */
        public function validateSha1Base36Hash( $hash ) {
-               return preg_match( '/^[a-z0-9]{31}$/', $hash );
+               return (bool)preg_match( '/^[a-z0-9]{31}$/', $hash );
        }
 
        /**
diff --git a/includes/api/ApiQueryCategoryMembers.php 
b/includes/api/ApiQueryCategoryMembers.php
index 02961aa..3a8847c 100644
--- a/includes/api/ApiQueryCategoryMembers.php
+++ b/includes/api/ApiQueryCategoryMembers.php
@@ -53,7 +53,7 @@
         */
        private function validateHexSortkey( $hexSortkey ) {
                // A hex sortkey has an unbound number of 2 letter pairs
-               return preg_match( '/^(?:[a-fA-F0-9]{2})*$/D', $hexSortkey );
+               return (bool)preg_match( '/^(?:[a-fA-F0-9]{2})*$/D', 
$hexSortkey );
        }
 
        /**
diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php
index e29fda5..37ee3e7 100644
--- a/includes/api/ApiStashEdit.php
+++ b/includes/api/ApiStashEdit.php
@@ -168,7 +168,7 @@
         * @param Content $content Edit content
         * @param User $user
         * @param string $summary Edit summary
-        * @return integer ApiStashEdit::ERROR_* constant
+        * @return string ApiStashEdit::ERROR_* constant
         * @since 1.25
         */
        public static function parseAndStash( WikiPage $page, Content $content, 
User $user, $summary ) {
diff --git a/includes/cache/FileCacheBase.php b/includes/cache/FileCacheBase.php
index e25f882..6d5f8c3 100644
--- a/includes/cache/FileCacheBase.php
+++ b/includes/cache/FileCacheBase.php
@@ -154,7 +154,7 @@
        /**
         * Save and compress text to the cache
         * @param string $text
-        * @return string Compressed text
+        * @return string|false Compressed text
         */
        public function saveText( $text ) {
                if ( $this->useGzip() ) {
diff --git a/includes/cache/localisation/LocalisationCache.php 
b/includes/cache/localisation/LocalisationCache.php
index 4b6362f..90b3de1 100644
--- a/includes/cache/localisation/LocalisationCache.php
+++ b/includes/cache/localisation/LocalisationCache.php
@@ -313,7 +313,7 @@
         * array.
         * @param string $code
         * @param string $key
-        * @return bool|null|string
+        * @return bool|null|string|string[]
         */
        public function getSubitemList( $code, $key ) {
                if ( in_array( $key, self::$splitKeys ) ) {
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 2f9f809..7c4bb3b 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -332,7 +332,7 @@
        }
 
        /**
-        * @return string
+        * @return string|int
         */
        public function lastErrno() {
                $err = sqlsrv_errors( SQLSRV_ERR_ALL );
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index 9258506..c3502f6 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -993,7 +993,7 @@
         *
         * @param array|string $table
         * @param string $field
-        * @return ORAField|ORAResult
+        * @return ORAField|ORAResult|false
         */
        private function fieldInfoMulti( $table, $field ) {
                $field = strtoupper( $field );
diff --git a/includes/debug/logger/LegacyLogger.php 
b/includes/debug/logger/LegacyLogger.php
index 4614c46..baf4637 100644
--- a/includes/debug/logger/LegacyLogger.php
+++ b/includes/debug/logger/LegacyLogger.php
@@ -378,7 +378,7 @@
                        if ( is_nan( $item ) ) {
                                return 'NaN';
                        }
-                       return $item;
+                       return (string)$item;
                }
 
                if ( is_scalar( $item ) ) {
diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php
index d38319e..a08bd9e 100644
--- a/includes/diff/DairikiDiff.php
+++ b/includes/diff/DairikiDiff.php
@@ -67,7 +67,7 @@
 
        /**
         * @param int $i
-        * @return string|null
+        * @return string[]|string|null
         */
        public function getClosing( $i = null ) {
                if ( $i === null ) {
diff --git a/includes/diff/DifferenceEngine.php 
b/includes/diff/DifferenceEngine.php
index bd65fb4..ca8a48c 100644
--- a/includes/diff/DifferenceEngine.php
+++ b/includes/diff/DifferenceEngine.php
@@ -210,7 +210,7 @@
                if ( $link ) {
                        return "[$link $id]";
                } else {
-                       return $id;
+                       return (string)$id;
                }
        }
 
diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php
index 66dab99..41f5281 100644
--- a/includes/filerepo/FileRepo.php
+++ b/includes/filerepo/FileRepo.php
@@ -99,7 +99,7 @@
         */
        protected $pathDisclosureProtection = 'simple';
 
-       /** @var bool Public zone URL. */
+       /** @var string|false Public zone URL. */
        protected $url;
 
        /** @var string The base thumbnail URL. Defaults to "<url>/thumb". */
@@ -309,7 +309,7 @@
         * @return bool Whether non-ASCII path characters are allowed
         */
        public function backendSupportsUnicodePaths() {
-               return ( $this->getBackend()->getFeatures() & 
FileBackend::ATTR_UNICODE_PATHS );
+               return (bool)( $this->getBackend()->getFeatures() & 
FileBackend::ATTR_UNICODE_PATHS );
        }
 
        /**
@@ -737,7 +737,7 @@
         * constructor, whereas local repositories use the local Title 
functions.
         *
         * @param string $name
-        * @return string
+        * @return string|false
         */
        public function getDescriptionUrl( $name ) {
                $encName = wfUrlencode( $name );
@@ -771,7 +771,7 @@
         *
         * @param string $name Name of image to fetch
         * @param string $lang Language to fetch it in, if any.
-        * @return string
+        * @return string|false
         */
        public function getDescriptionRenderUrl( $name, $lang = null ) {
                $query = 'action=render';
diff --git a/includes/filerepo/ForeignAPIRepo.php 
b/includes/filerepo/ForeignAPIRepo.php
index 4176c82..ca41718 100644
--- a/includes/filerepo/ForeignAPIRepo.php
+++ b/includes/filerepo/ForeignAPIRepo.php
@@ -109,7 +109,7 @@
         *
         * @param Title $title
         * @param string|bool $time
-        * @return File
+        * @return File|false
         */
        function newFile( $title, $time = false ) {
                if ( $time ) {
diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php
index d47624f..2edd6d0 100644
--- a/includes/filerepo/RepoGroup.php
+++ b/includes/filerepo/RepoGroup.php
@@ -334,7 +334,7 @@
        /**
         * Get the repo instance by its name
         * @param string $name
-        * @return bool
+        * @return FileRepo|bool
         */
        function getRepoByName( $name ) {
                if ( !$this->reposInitialised ) {
diff --git a/includes/filerepo/file/ArchivedFile.php 
b/includes/filerepo/file/ArchivedFile.php
index 921e129..9a7a55b 100644
--- a/includes/filerepo/file/ArchivedFile.php
+++ b/includes/filerepo/file/ArchivedFile.php
@@ -81,7 +81,7 @@
        /** @var string SHA-1 hash of file content */
        private $sha1;
 
-       /** @var string Number of pages of a multipage document, or false for
+       /** @var int|false Number of pages of a multipage document, or false for
         * documents which aren't multipage documents
         */
        private $pageCount;
@@ -496,7 +496,7 @@
         * Return the user name of the uploader.
         *
         * @deprecated since 1.23 Use getUser( 'text' ) instead.
-        * @return string
+        * @return string|int
         */
        public function getUserText() {
                wfDeprecated( __METHOD__, '1.23' );
@@ -511,7 +511,7 @@
        /**
         * Return upload description.
         *
-        * @return string
+        * @return string|int
         */
        public function getDescription() {
                $this->load();
diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php
index 9188cd9..8be662f 100644
--- a/includes/filerepo/file/File.php
+++ b/includes/filerepo/file/File.php
@@ -127,7 +127,7 @@
        /** @var string Relative path including trailing slash */
        protected $hashPath;
 
-       /** @var string Number of pages of a multipage document, or false for
+       /** @var string|false Number of pages of a multipage document, or false 
for
         *    documents which aren't multipage documents
         */
        protected $pageCount;
@@ -535,7 +535,7 @@
        /**
         * Get the duration of a media file in seconds
         *
-        * @return int
+        * @return float|int
         */
        public function getLength() {
                $handler = $this->getHandler();
@@ -909,7 +909,7 @@
         *
         * @param array $handlerParams
         *
-        * @return string
+        * @return ThumbnailImage|MediaTransformOutput|bool False on failure
         */
        function getUnscaledThumb( $handlerParams = [] ) {
                $hp =& $handlerParams;
@@ -1963,7 +1963,7 @@
         * Returns the number of pages of a multipage document, or false for
         * documents which aren't multipage documents
         *
-        * @return bool|int
+        * @return string|bool|int
         */
        function pageCount() {
                if ( !isset( $this->pageCount ) ) {
@@ -1991,7 +1991,7 @@
                if ( $srcWidth == 0 ) {
                        return 0;
                } else {
-                       return round( $srcHeight * $dstWidth / $srcWidth );
+                       return (int)round( $srcHeight * $dstWidth / $srcWidth );
                }
        }
 
@@ -2003,7 +2003,7 @@
         *  a good reason. This method skips all caches.
         *
         * @param string $filePath The path to the file (e.g. From 
getLocalPathRef() )
-        * @return array The width, followed by height, with optionally more 
things after
+        * @return array|false The width, followed by height, with optionally 
more things after
         */
        function getImageSize( $filePath ) {
                if ( !$this->getHandler() ) {
@@ -2031,7 +2031,7 @@
         * Get the HTML text of the description page, if available
         *
         * @param bool|Language $lang Optional language to fetch description in
-        * @return string
+        * @return string|false
         */
        function getDescriptionText( $lang = false ) {
                global $wgLang;
@@ -2122,7 +2122,7 @@
        /**
         * Get the deletion archive key, "<sha1>.<ext>"
         *
-        * @return string
+        * @return string|false
         */
        function getStorageKey() {
                $hash = $this->getSha1();
diff --git a/includes/filerepo/file/ForeignDBFile.php 
b/includes/filerepo/file/ForeignDBFile.php
index df50a67..c6c49b4 100644
--- a/includes/filerepo/file/ForeignDBFile.php
+++ b/includes/filerepo/file/ForeignDBFile.php
@@ -121,7 +121,7 @@
 
        /**
         * @param bool|Language $lang Optional language to fetch description in.
-        * @return string
+        * @return string|false
         */
        function getDescriptionText( $lang = false ) {
                global $wgLang;
diff --git a/includes/htmlform/HTMLFormField.php 
b/includes/htmlform/HTMLFormField.php
index 71aa275..804bbff 100644
--- a/includes/htmlform/HTMLFormField.php
+++ b/includes/htmlform/HTMLFormField.php
@@ -1034,7 +1034,7 @@
         * with integer 0 as a value.
         *
         * @param array $array
-        * @return array
+        * @return array|string
         */
        public static function forceToStringRecursive( $array ) {
                if ( is_array( $array ) ) {
diff --git a/includes/htmlform/fields/HTMLButtonField.php 
b/includes/htmlform/fields/HTMLButtonField.php
index 285490b..500b502 100644
--- a/includes/htmlform/fields/HTMLButtonField.php
+++ b/includes/htmlform/fields/HTMLButtonField.php
@@ -127,6 +127,6 @@
                $request = $this->mParent
                        ? $this->mParent->getRequest()
                        : RequestContext::getMain()->getRequest();
-               return preg_match( '/MSIE [1-7]\./i', $request->getHeader( 
'User-Agent' ) );
+               return (bool)preg_match( '/MSIE [1-7]\./i', 
$request->getHeader( 'User-Agent' ) );
        }
 }
diff --git a/includes/htmlform/fields/HTMLMultiSelectField.php 
b/includes/htmlform/fields/HTMLMultiSelectField.php
index 05a2ba6..23044bd 100644
--- a/includes/htmlform/fields/HTMLMultiSelectField.php
+++ b/includes/htmlform/fields/HTMLMultiSelectField.php
@@ -149,7 +149,7 @@
        /**
         * @param WebRequest $request
         *
-        * @return string
+        * @return string|array
         */
        public function loadDataFromRequest( $request ) {
                if ( $this->isSubmitAttempt( $request ) ) {
diff --git a/includes/htmlform/fields/HTMLSizeFilterField.php 
b/includes/htmlform/fields/HTMLSizeFilterField.php
index d94eb8d..5ad7ee3 100644
--- a/includes/htmlform/fields/HTMLSizeFilterField.php
+++ b/includes/htmlform/fields/HTMLSizeFilterField.php
@@ -49,7 +49,7 @@
        /**
         * @param WebRequest $request
         *
-        * @return string
+        * @return string|int
         */
        public function loadDataFromRequest( $request ) {
                $size = $request->getInt( $this->mName );
diff --git a/includes/http/Http.php b/includes/http/Http.php
index 8255bb3..779d606 100644
--- a/includes/http/Http.php
+++ b/includes/http/Http.php
@@ -142,7 +142,7 @@
         * @return bool
         */
        public static function isValidURI( $uri ) {
-               return preg_match(
+               return (bool)preg_match(
                        '/^https?:\/\/[^\/\s]\S*$/D',
                        $uri
                );
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 03f9974..9dc8032 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -567,7 +567,7 @@
        /**
         * Determine if LocalSettings.php exists. If it does, return its 
variables.
         *
-        * @return array
+        * @return array|false
         */
        public static function getExistingLocalSettings() {
                global $IP;
@@ -1080,7 +1080,7 @@
        /**
         * Convert a hex string representing a Unicode code point to that code 
point.
         * @param string $c
-        * @return string
+        * @return string|false
         */
        protected function unicodeChar( $c ) {
                $c = hexdec( $c );
diff --git a/includes/installer/LocalSettingsGenerator.php 
b/includes/installer/LocalSettingsGenerator.php
index a9e3e85..697188e 100644
--- a/includes/installer/LocalSettingsGenerator.php
+++ b/includes/installer/LocalSettingsGenerator.php
@@ -109,7 +109,7 @@
         *
         * @param string $string
         *
-        * @return string
+        * @return string|false
         */
        public static function escapePhpString( $string ) {
                if ( is_array( $string ) || is_object( $string ) ) {
diff --git a/includes/interwiki/ClassicInterwikiLookup.php 
b/includes/interwiki/ClassicInterwikiLookup.php
index 0e107b3..4ccca97 100644
--- a/includes/interwiki/ClassicInterwikiLookup.php
+++ b/includes/interwiki/ClassicInterwikiLookup.php
@@ -187,7 +187,7 @@
         * @note More logic is explained in DefaultSettings.
         *
         * @param string $prefix Interwiki prefix
-        * @return Interwiki
+        * @return Interwiki|false
         */
        private function getInterwikiCached( $prefix ) {
                $value = $this->getInterwikiCacheEntry( $prefix );
diff --git a/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php 
b/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php
index 6ae8837..d9457c6 100644
--- a/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php
+++ b/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php
@@ -126,7 +126,7 @@
 
        /**
         * @param string $name
-        * @return string
+        * @return string[]
         */
        private function decodeQueueName( $name ) {
                list( $type, $wiki ) = explode( '/', $name, 2 );
diff --git a/includes/libs/ExplodeIterator.php 
b/includes/libs/ExplodeIterator.php
index 3b34d9b..d4abdc8 100644
--- a/includes/libs/ExplodeIterator.php
+++ b/includes/libs/ExplodeIterator.php
@@ -40,7 +40,7 @@
        // The position after the end of the next delimiter
        private $endPos;
 
-       // The current token
+       /** @var string|false The current token */
        private $current;
 
        /**
diff --git a/includes/libs/HashRing.php b/includes/libs/HashRing.php
index 70ce31d..4ddb813 100644
--- a/includes/libs/HashRing.php
+++ b/includes/libs/HashRing.php
@@ -32,7 +32,7 @@
        /** @var Array (location => (start, end)) */
        protected $ring = [];
 
-       /** @var Array (location => (start, end)) */
+       /** @var HashRing|null */
        protected $liveRing;
        /** @var Array (location => UNIX timestamp) */
        protected $ejectionExpiries = [];
diff --git a/includes/libs/filebackend/FileBackendStore.php 
b/includes/libs/filebackend/FileBackendStore.php
index bd2ce5d..a7ceab2 100644
--- a/includes/libs/filebackend/FileBackendStore.php
+++ b/includes/libs/filebackend/FileBackendStore.php
@@ -729,7 +729,7 @@
        /**
         * @see FileBackendStore::getFileXAttributes()
         * @param array $params
-        * @return bool|string
+        * @return array[][]
         */
        protected function doGetFileXAttributes( array $params ) {
                return [ 'headers' => [], 'metadata' => [] ]; // not supported
diff --git a/includes/libs/filebackend/SwiftFileBackend.php 
b/includes/libs/filebackend/SwiftFileBackend.php
index 08cb388..d40e896 100644
--- a/includes/libs/filebackend/SwiftFileBackend.php
+++ b/includes/libs/filebackend/SwiftFileBackend.php
@@ -1701,7 +1701,7 @@
         * @param array $creds From getAuthentication()
         * @param string $container
         * @param string $object
-        * @return array
+        * @return string
         */
        protected function storageUrl( array $creds, $container = null, $object 
= null ) {
                $parts = [ $creds['storage_url'] ];
diff --git a/languages/Language.php b/languages/Language.php
index 2e4ef89..4cb491a 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -2577,7 +2577,7 @@
 
        /**
         * @param string $key
-        * @return array|null
+        * @return string|null
         */
        public function getMessage( $key ) {
                return self::$dataCache->getSubitem( $this->mCode, 'messages', 
$key );

-- 
To view, visit https://gerrit.wikimedia.org/r/325881
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com>
Gerrit-Reviewer: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: Skizzerz <skizz...@skizzerz.net>
Gerrit-Reviewer: TTO <at.li...@live.com.au>
Gerrit-Reviewer: Tpt <thoma...@hotmail.fr>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to