From: Daimona Eaytoy Date: Fri, 30 Aug 2019 16:01:28 +0000 (+0200) Subject: Unsuppress other phan issues (part 4) X-Git-Tag: 1.34.0-rc.0~464^2 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=e70b5b33095c3db1fa2332d7184f3ae80c1dd571;p=lhc%2Fweb%2Fwiklou.git Unsuppress other phan issues (part 4) Bug: T231636 Depends-On: I58e67c2b38389df874438deada4239510d21654f Change-Id: I6e5fba7bd273219b1206559420b5bdb78734aa84 --- diff --git a/.phan/config.php b/.phan/config.php index bc9526ac57..29729ae1c7 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -84,14 +84,10 @@ $cfg['suppress_issue_types'] = array_merge( $cfg['suppress_issue_types'], [ "PhanParamTooMany", // approximate error count: 63 "PhanTypeArraySuspicious", - // approximate error count: 28 - "PhanTypeArraySuspiciousNullable", // approximate error count: 88 "PhanTypeInvalidDimOffset", // approximate error count: 60 "PhanTypeMismatchArgument", - // approximate error count: 40 - "PhanTypeMismatchProperty", // approximate error count: 36 "PhanUndeclaredConstant", // approximate error count: 219 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 9e7dd8ff16..4ae9237116 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1127,6 +1127,7 @@ function wfLogProfilingData() { if ( isset( $ctx['forwarded_for'] ) || isset( $ctx['client_ip'] ) || isset( $ctx['from'] ) ) { + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable $ctx['proxy'] = $_SERVER['REMOTE_ADDR']; } diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 327bc8fa74..170356541c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -44,7 +44,7 @@ use Wikimedia\WrappedStringList; * @todo document */ class OutputPage extends ContextSource { - /** @var array Should be private. Used with addMeta() which adds "" */ + /** @var string[][] Should be private. Used with addMeta() which adds "" */ protected $mMetatags = []; /** @var array */ diff --git a/includes/Permissions/PermissionManager.php b/includes/Permissions/PermissionManager.php index 6c614f6ef8..0a8e515a32 100644 --- a/includes/Permissions/PermissionManager.php +++ b/includes/Permissions/PermissionManager.php @@ -85,8 +85,8 @@ class PermissionManager { /** @var NamespaceInfo */ private $nsInfo; - /** @var string[] Cached results of getAllRights() */ - private $allRights = false; + /** @var string[]|null Cached results of getAllRights() */ + private $allRights; /** @var string[][] Cached user rights */ private $usersRights = null; @@ -1471,7 +1471,7 @@ class PermissionManager { * @return string[] Array of permission names */ public function getAllPermissions() { - if ( $this->allRights === false ) { + if ( $this->allRights === null ) { if ( count( $this->options->get( 'AvailableRights' ) ) ) { $this->allRights = array_unique( array_merge( $this->coreRights, diff --git a/includes/Title.php b/includes/Title.php index 8c5bbdc221..3bf87c28f9 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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. @@ -3163,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; } diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 8b6a3e582f..d8134bb6b7 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -274,7 +274,7 @@ abstract class ApiBase extends ContextSource { /** @var array Maps extension paths to info arrays */ private static $extensionInfo = null; - /** @var int[][][] Cache for self::filterIDs() */ + /** @var stdClass[][] Cache for self::filterIDs() */ private static $filterIDsCache = []; /** $var array Map of web UI block messages to corresponding API messages and codes */ diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 3f63a0085a..e631e3f638 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -62,9 +62,7 @@ class ApiEditPage extends ApiBase { /** @var Title $newTitle */ foreach ( $titles as $id => $newTitle ) { - if ( !isset( $titles[$id - 1] ) ) { - $titles[$id - 1] = $oldTitle; - } + $titles[ $id - 1 ] = $titles[ $id - 1 ] ?? $oldTitle; $redirValues[] = [ 'from' => $titles[$id - 1]->getPrefixedText(), diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index 8e2837b324..6a575ec3e0 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -111,6 +111,8 @@ class ApiOpenSearch extends ApiBase { * @param string $search the search query * @param array $params api request params * @return array search results. Keys are integers. + * @phan-return array + * Note that phan annotations don't support keys containing a space. */ private function search( $search, array $params ) { $searchEngine = $this->buildSearchEngine( $params ); @@ -247,6 +249,7 @@ class ApiOpenSearch extends ApiBase { if ( is_string( $r['extract'] ) && $r['extract'] !== '' ) { $item['Description'] = $r['extract']; } + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable if ( is_array( $r['image'] ) && isset( $r['image']['source'] ) ) { $item['Image'] = array_intersect_key( $r['image'], $imageKeys ); } diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 8e26d37e08..ce51a672ba 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -332,8 +332,8 @@ class ApiQueryUsers extends ApiQueryBase { } } - $fit = $result->addValue( [ 'query', $this->getModuleName() ], - null, $data[$u] ); + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable + $fit = $result->addValue( [ 'query', $this->getModuleName() ], null, $data[$u] ); if ( !$fit ) { if ( $useNames ) { $this->setContinueEnumParameter( 'users', diff --git a/includes/auth/AuthenticationRequest.php b/includes/auth/AuthenticationRequest.php index 420034191e..f59760a39c 100644 --- a/includes/auth/AuthenticationRequest.php +++ b/includes/auth/AuthenticationRequest.php @@ -337,12 +337,14 @@ abstract class AuthenticationRequest { } $options['sensitive'] = !empty( $options['sensitive'] ); + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable + $type = $options['type']; if ( !array_key_exists( $name, $merged ) ) { $merged[$name] = $options; - } elseif ( $merged[$name]['type'] !== $options['type'] ) { + } elseif ( $merged[$name]['type'] !== $type ) { throw new \UnexpectedValueException( "Field type conflict for \"$name\", " . - "\"{$merged[$name]['type']}\" vs \"{$options['type']}\"" + "\"{$merged[$name]['type']}\" vs \"$type\"" ); } else { if ( isset( $options['options'] ) ) { diff --git a/includes/cache/CacheHelper.php b/includes/cache/CacheHelper.php index d798ddbcb3..d1261a8076 100644 --- a/includes/cache/CacheHelper.php +++ b/includes/cache/CacheHelper.php @@ -82,9 +82,9 @@ class CacheHelper implements ICacheHelper { * Function that gets called when initialization is done. * * @since 1.20 - * @var callable + * @var callable|null */ - protected $onInitHandler = false; + protected $onInitHandler; /** * Elements to build a cache key with. @@ -183,7 +183,7 @@ class CacheHelper implements ICacheHelper { $this->hasCached = is_array( $cachedChunks ); $this->cachedChunks = $this->hasCached ? $cachedChunks : []; - if ( $this->onInitHandler !== false ) { + if ( $this->onInitHandler !== null ) { call_user_func( $this->onInitHandler, $this->hasCached ); } } diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 3a6d8924ba..848d9c907a 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -1191,6 +1191,7 @@ class MessageCache { $class = $wgParserConf['class']; if ( $class == ParserDiffTest::class ) { # Uncloneable + // @phan-suppress-next-line PhanTypeMismatchProperty $this->mParser = new $class( $wgParserConf ); } else { $this->mParser = clone $parser; diff --git a/includes/cache/localisation/LCStoreCDB.php b/includes/cache/localisation/LCStoreCDB.php index aad9439ad6..fd9af39515 100644 --- a/includes/cache/localisation/LCStoreCDB.php +++ b/includes/cache/localisation/LCStoreCDB.php @@ -33,7 +33,7 @@ use Cdb\Writer; */ class LCStoreCDB implements LCStore { - /** @var Reader[] */ + /** @var Reader[]|false[] */ private $readers; /** @var Writer */ diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 0c6a3d1659..edaa963ffe 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -94,12 +94,12 @@ class RecentChange implements Taggable { public $mExtra = []; /** - * @var Title + * @var Title|false */ public $mTitle = false; /** - * @var User + * @var User|false */ private $mPerformer = false; diff --git a/includes/diff/DiffOp.php b/includes/diff/DiffOp.php index 2a1f3e18dc..df2792f2a8 100644 --- a/includes/diff/DiffOp.php +++ b/includes/diff/DiffOp.php @@ -42,12 +42,12 @@ abstract class DiffOp { public $type; /** - * @var string[] + * @var string[]|false */ public $orig; /** - * @var string[] + * @var string[]|false */ public $closing; diff --git a/includes/filerepo/file/ForeignAPIFile.php b/includes/filerepo/file/ForeignAPIFile.php index ab8ef2f8de..99ead166ed 100644 --- a/includes/filerepo/file/ForeignAPIFile.php +++ b/includes/filerepo/file/ForeignAPIFile.php @@ -75,6 +75,7 @@ class ForeignAPIFile extends File { ? count( $data['query']['redirects'] ) - 1 : -1; if ( $lastRedirect >= 0 ) { + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable $newtitle = Title::newFromText( $data['query']['redirects'][$lastRedirect]['to'] ); $img = new self( $newtitle, $repo, $info, true ); $img->redirectedFrom( $title->getDBkey() ); diff --git a/includes/gallery/ImageGalleryBase.php b/includes/gallery/ImageGalleryBase.php index 991ef79f87..c6d8ddf3db 100644 --- a/includes/gallery/ImageGalleryBase.php +++ b/includes/gallery/ImageGalleryBase.php @@ -75,7 +75,7 @@ abstract class ImageGalleryBase extends ContextSource { protected $mHideBadImages; /** - * @var Parser Registered parser object for output callbacks + * @var Parser|false Registered parser object for output callbacks */ public $mParser; @@ -88,8 +88,8 @@ abstract class ImageGalleryBase extends ContextSource { /** @var array */ protected $mAttribs = []; - /** @var bool */ - private static $modeMapping = false; + /** @var array */ + private static $modeMapping; /** * Get a new image gallery. This is the method other callers @@ -121,7 +121,7 @@ abstract class ImageGalleryBase extends ContextSource { } private static function loadModes() { - if ( self::$modeMapping === false ) { + if ( self::$modeMapping === null ) { self::$modeMapping = [ 'traditional' => TraditionalImageGallery::class, 'nolines' => NolinesImageGallery::class, diff --git a/includes/htmlform/fields/HTMLAutoCompleteSelectField.php b/includes/htmlform/fields/HTMLAutoCompleteSelectField.php index 4ae52a9f44..41c0b3c72b 100644 --- a/includes/htmlform/fields/HTMLAutoCompleteSelectField.php +++ b/includes/htmlform/fields/HTMLAutoCompleteSelectField.php @@ -29,6 +29,8 @@ * The old name of autocomplete-data[-messages] was autocomplete[-messages] which is still * recognized but deprecated since MediaWiki 1.29 since it conflicts with how autocomplete is * used in HTMLTextField. + * + * @phan-file-suppress PhanTypeMismatchProperty This is doing weird things with mClass */ class HTMLAutoCompleteSelectField extends HTMLTextField { protected $autocompleteData = []; diff --git a/includes/http/GuzzleHttpRequest.php b/includes/http/GuzzleHttpRequest.php index 3af7f56a5d..fa6dad719f 100644 --- a/includes/http/GuzzleHttpRequest.php +++ b/includes/http/GuzzleHttpRequest.php @@ -41,6 +41,7 @@ class GuzzleHttpRequest extends MWHttpRequest { protected $handler = null; protected $sink = null; + /** @var array */ protected $guzzleOptions = [ 'http_errors' => false ]; /** diff --git a/includes/libs/filebackend/SwiftFileBackend.php b/includes/libs/filebackend/SwiftFileBackend.php index 1e9c7c595a..6d6451e32b 100644 --- a/includes/libs/filebackend/SwiftFileBackend.php +++ b/includes/libs/filebackend/SwiftFileBackend.php @@ -1049,6 +1049,7 @@ class SwiftFileBackend extends FileBackendStore { $stat = $this->getFileStat( $params ); } + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable return $stat['xattr']; } else { return false; diff --git a/includes/libs/rdbms/database/position/MySQLMasterPos.php b/includes/libs/rdbms/database/position/MySQLMasterPos.php index 54eca79a44..fa2c1dbec2 100644 --- a/includes/libs/rdbms/database/position/MySQLMasterPos.php +++ b/includes/libs/rdbms/database/position/MySQLMasterPos.php @@ -17,7 +17,7 @@ use UnexpectedValueException; * @see https://dev.mysql.com/doc/refman/5.6/en/replication-gtids-concepts.html */ class MySQLMasterPos implements DBMasterPos { - /** @var int One of (BINARY_LOG, GTID_MYSQL, GTID_MARIA) */ + /** @var string One of (BINARY_LOG, GTID_MYSQL, GTID_MARIA) */ private $style; /** @var string|null Base name of all Binary Log files */ private $binLog; diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 585a7822f7..771700c5a1 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -68,7 +68,9 @@ class LoadBalancer implements ILoadBalancer { /** @var DatabaseDomain Local DB domain ID and default for selectDB() calls */ private $localDomain; - /** @var Database[][][] Map of (connection category => server index => IDatabase[]) */ + /** + * @var IDatabase[][][]|Database[][][] Map of (connection category => server index => IDatabase[]) + */ private $conns; /** @var array[] Map of (server index => server config array) */ @@ -99,7 +101,7 @@ class LoadBalancer implements ILoadBalancer { private $tableAliases = []; /** @var string[] Map of (index alias => index) */ private $indexAliases = []; - /** @var array[] Map of (name => callable) */ + /** @var callable[] Map of (name => callable) */ private $trxRecurringCallbacks = []; /** @var bool[] Map of (domain => whether to use "temp tables only" mode) */ private $tempTablesOnlyMode = []; diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index f328760827..39937954e4 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -98,6 +98,7 @@ class FormatMetadata extends ContextSource { * Exif::getFilteredData() or BitmapMetadataHandler ) * @return array * @since 1.23 + * @suppress PhanTypeArraySuspiciousNullable */ public function makeFormattedData( $tags ) { $resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3; diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index e634edc750..d713396b57 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -144,7 +144,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { $this->numServerShards = count( $this->serverInfos ); } else { // Default to using the main wiki's database servers - $this->serverInfos = false; + $this->serverInfos = []; $this->numServerShards = 1; $this->attrMap[self::ATTR_SYNCWRITES] = self::QOS_SYNCWRITES_BE; } diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 460753514c..b4b59272a8 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -68,7 +68,9 @@ class WikiPage implements Page, IDBAccessObject { */ public $mLatest = false; - /** @var PreparedEdit Map of cache fields (text, parser output, ect) for a proposed/new edit */ + /** + * @var PreparedEdit|false Map of cache fields (text, parser output, ect) for a proposed/new edit + */ public $mPreparedEdit = false; /** diff --git a/includes/resourceloader/DerivativeResourceLoaderContext.php b/includes/resourceloader/DerivativeResourceLoaderContext.php index cf0b3c275a..d84a92a914 100644 --- a/includes/resourceloader/DerivativeResourceLoaderContext.php +++ b/includes/resourceloader/DerivativeResourceLoaderContext.php @@ -35,6 +35,7 @@ class DerivativeResourceLoaderContext extends ResourceLoaderContext { */ private $context; + /** @var int|array */ protected $modules = self::INHERIT_VALUE; protected $language = self::INHERIT_VALUE; protected $direction = self::INHERIT_VALUE; @@ -54,7 +55,7 @@ class DerivativeResourceLoaderContext extends ResourceLoaderContext { if ( $this->modules === self::INHERIT_VALUE ) { return $this->context->getModules(); } - // @phan-suppress-next-line PhanTypeMismatchReturn + return $this->modules; } diff --git a/includes/resourceloader/ResourceLoaderContext.php b/includes/resourceloader/ResourceLoaderContext.php index eab5de0abb..95b8ff0073 100644 --- a/includes/resourceloader/ResourceLoaderContext.php +++ b/includes/resourceloader/ResourceLoaderContext.php @@ -55,6 +55,7 @@ class ResourceLoaderContext implements MessageLocalizer { protected $direction; protected $hash; protected $userObj; + /** @var ResourceLoaderImage|false */ protected $imageObj; /** diff --git a/includes/specials/pagers/BlockListPager.php b/includes/specials/pagers/BlockListPager.php index 77b732635e..d61a1beed9 100644 --- a/includes/specials/pagers/BlockListPager.php +++ b/includes/specials/pagers/BlockListPager.php @@ -70,6 +70,12 @@ class BlockListPager extends TablePager { return $headers; } + /** + * @param string $name + * @param string $value + * @return string + * @suppress PhanTypeArraySuspiciousNullable + */ function formatValue( $name, $value ) { static $msg = null; if ( $msg === null ) { diff --git a/includes/user/User.php b/includes/user/User.php index 23c4cfb0de..82f2ddc7f5 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -110,12 +110,6 @@ class User implements IDBAccessObject, UserIdentity { 'mActorId', ]; - /** - * @var string[] - * @var string[] Cached results of getAllRights() - */ - protected static $mAllRights = false; - /** Cache variables */ // @{ /** @var int */ diff --git a/includes/utils/ClassCollector.php b/includes/utils/ClassCollector.php index a9f7dd24bb..cf62f6d008 100644 --- a/includes/utils/ClassCollector.php +++ b/includes/utils/ClassCollector.php @@ -39,7 +39,7 @@ class ClassCollector { protected $startToken; /** - * @var array List of tokens that are members of the current expect sequence + * @var array[]|string[] List of tokens that are members of the current expect sequence */ protected $tokens; diff --git a/includes/widget/search/SearchFormWidget.php b/includes/widget/search/SearchFormWidget.php index 62ee9cb6f1..fedac4b52b 100644 --- a/includes/widget/search/SearchFormWidget.php +++ b/includes/widget/search/SearchFormWidget.php @@ -148,6 +148,7 @@ class SearchFormWidget { * @param string $profile The currently selected profile * @param string $term The user provided search terms * @return string HTML + * @suppress PhanTypeArraySuspiciousNullable */ protected function profileTabsHtml( $profile, $term ) { $bareterm = $this->startsWithImage( $term ) diff --git a/languages/Language.php b/languages/Language.php index 913620367b..7ee6a65b5a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -61,7 +61,9 @@ class Language { public $mVariants, $mCode, $mLoaded = false; public $mMagicExtensions = []; - private $mHtmlCode = null, $mParentLanguage = false; + private $mHtmlCode = null; + /** @var Language|false */ + private $mParentLanguage = false; public $dateFormatStrings = []; public $mExtendedSpecialPageAliases; @@ -455,6 +457,7 @@ class Language { } function __construct() { + // @phan-suppress-next-line PhanTypeMismatchProperty $this->mConverter = new FakeConverter( $this ); // Set the code to the name of the descendant if ( static::class === 'Language' ) { @@ -3235,6 +3238,7 @@ class Language { $fallbackChain = array_reverse( $fallbackChain ); foreach ( $fallbackChain as $code ) { if ( isset( $newWords[$code] ) ) { + // @phan-suppress-next-line PhanTypeMismatchProperty $this->mMagicExtensions = $newWords[$code] + $this->mMagicExtensions; } } diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index d1a5720249..350aa67947 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -63,8 +63,7 @@ class LanguageConverter { public $mTablesLoaded = false; /** - * @var ReplacementArray[] - * @phan-var array + * @var ReplacementArray[]|bool[] */ public $mTables; @@ -958,7 +957,7 @@ class LanguageConverter { } $this->mTablesLoaded = true; - $this->mTables = false; + $this->mTables = null; $cache = ObjectCache::getInstance( $wgLanguageConverterCacheType ); $cacheKey = $cache->makeKey( 'conversiontables', $this->mMainLanguageCode ); if ( $fromCache ) { diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 1142325994..ce4063842c 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -358,6 +358,7 @@ class CopyFileBackend extends Maintenance { // backends in FileBackendMultiWrite (since they get writes second, they have // higher timestamps). However, when copying the other way, this hits loads of // false positives (possibly 100%) and wastes a bunch of time on GETs/PUTs. + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable $same = ( $srcStat['mtime'] <= $dstStat['mtime'] ); } else { // This is the slowest method which does many per-file HEADs (unless an object diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index aef45bff67..4c3fe7ba2d 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -132,7 +132,7 @@ class GenerateSitemap extends Maintenance { /** * A resource pointing to a sitemap file * - * @var resource + * @var resource|false */ public $file; diff --git a/maintenance/importDump.php b/maintenance/importDump.php index c2c5ccf40e..0ff362218a 100644 --- a/maintenance/importDump.php +++ b/maintenance/importDump.php @@ -41,6 +41,7 @@ class BackupReader extends Maintenance { public $uploads = false; protected $uploadCount = 0; public $imageBasePath = false; + /** @var array|false */ public $nsFilter = false; function __construct() { diff --git a/maintenance/includes/TextPassDumper.php b/maintenance/includes/TextPassDumper.php index 2e5cc4feb3..bcf84aaf60 100644 --- a/maintenance/includes/TextPassDumper.php +++ b/maintenance/includes/TextPassDumper.php @@ -74,14 +74,14 @@ class TextPassDumper extends BackupDumper { protected $spawnProc = false; /** - * @var bool|resource + * @var resource */ - protected $spawnWrite = false; + protected $spawnWrite; /** - * @var bool|resource + * @var resource */ - protected $spawnRead = false; + protected $spawnRead; /** * @var bool|resource @@ -809,11 +809,11 @@ TEXT if ( $this->spawnRead ) { fclose( $this->spawnRead ); } - $this->spawnRead = false; + $this->spawnRead = null; if ( $this->spawnWrite ) { fclose( $this->spawnWrite ); } - $this->spawnWrite = false; + $this->spawnWrite = null; if ( $this->spawnErr ) { fclose( $this->spawnErr ); } diff --git a/maintenance/storage/recompressTracked.php b/maintenance/storage/recompressTracked.php index 92b66792e7..316d2d2319 100644 --- a/maintenance/storage/recompressTracked.php +++ b/maintenance/storage/recompressTracked.php @@ -710,7 +710,7 @@ class CgzCopyTransaction { /** @var RecompressTracked */ public $parent; public $blobClass; - /** @var ConcatenatedGzipHistoryBlob */ + /** @var ConcatenatedGzipHistoryBlob|false */ public $cgz; public $referrers;