diff --git a/includes/MagicWordArray.php b/includes/MagicWordArray.php index bd9b074340d..74e6826c6d3 100644 --- a/includes/MagicWordArray.php +++ b/includes/MagicWordArray.php @@ -36,12 +36,13 @@ class MagicWordArray { /** @var MagicWordFactory */ private $factory; - /** @var array */ + /** @var array|null */ private $hash; /** @var string[]|null */ private $baseRegex; + /** @var string[]|null */ private $regex; /** diff --git a/includes/Revision/RevisionStoreCacheRecord.php b/includes/Revision/RevisionStoreCacheRecord.php index b3b3374309c..379b4b1d042 100644 --- a/includes/Revision/RevisionStoreCacheRecord.php +++ b/includes/Revision/RevisionStoreCacheRecord.php @@ -37,7 +37,7 @@ use MediaWiki\User\UserIdentity; class RevisionStoreCacheRecord extends RevisionStoreRecord { /** - * @var callable ( int $revId ): [ int $rev_deleted, UserIdentity $user ] + * @var null|callable ( int $revId ): [ int $rev_deleted, UserIdentity $user ] */ private $mCallback; diff --git a/includes/SiteStats.php b/includes/SiteStats.php index d0353d21f08..c63021cc617 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -29,7 +29,7 @@ use Wikimedia\Rdbms\ILoadBalancer; * Static accessor class for site_stats and related things */ class SiteStats { - /** @var stdClass */ + /** @var stdClass|null */ private static $row; /** diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 0088fa9d873..8299f146d63 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -446,7 +446,7 @@ class ApiMain extends ApiBase { ] ]; - /** @var ApiFormatBase */ + /** @var ApiFormatBase|null */ private $mPrinter; /** @var ApiModuleManager */ diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 35e4a593dae..0354dd0a62b 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -40,7 +40,7 @@ abstract class ApiQueryBase extends ApiBase { private $mQueryModule, $mDb; /** - * @var SelectQueryBuilder + * @var SelectQueryBuilder|null */ private $queryBuilder; diff --git a/includes/cache/localisation/LCStoreCDB.php b/includes/cache/localisation/LCStoreCDB.php index 215d821ee54..906b0fb77ad 100644 --- a/includes/cache/localisation/LCStoreCDB.php +++ b/includes/cache/localisation/LCStoreCDB.php @@ -36,7 +36,7 @@ class LCStoreCDB implements LCStore { /** @var Reader[]|false[] */ private $readers; - /** @var Writer */ + /** @var Writer|null */ private $writer; /** @var string Current language code */ diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index fdab06ceca9..9484fe804d0 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -72,7 +72,7 @@ class RequestContext implements IContextSource, MutableContext { private $authority; /** - * @var Language + * @var Language|null */ private $lang; @@ -92,7 +92,7 @@ class RequestContext implements IContextSource, MutableContext { private $config; /** - * @var RequestContext + * @var RequestContext|null */ private static $instance = null; diff --git a/includes/debug/logger/monolog/LegacyHandler.php b/includes/debug/logger/monolog/LegacyHandler.php index 12f679e3688..86d3b598f37 100644 --- a/includes/debug/logger/monolog/LegacyHandler.php +++ b/includes/debug/logger/monolog/LegacyHandler.php @@ -62,7 +62,7 @@ class LegacyHandler extends AbstractProcessingHandler { /** * Log sink - * @var resource + * @var resource|null */ protected $sink; diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 5cf55518c35..fcc148c7ae0 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -192,7 +192,7 @@ class DifferenceEngine extends ContextSource { /** @var bool Refresh the diff cache */ protected $mRefreshCache = false; - /** @var SlotDiffRenderer[] DifferenceEngine classes for the slots, keyed by role name. */ + /** @var SlotDiffRenderer[]|null DifferenceEngine classes for the slots, keyed by role name. */ protected $slotDiffRenderers = null; /** diff --git a/includes/historyblob/DiffHistoryBlob.php b/includes/historyblob/DiffHistoryBlob.php index 1ff90b34028..7741d2b083b 100644 --- a/includes/historyblob/DiffHistoryBlob.php +++ b/includes/historyblob/DiffHistoryBlob.php @@ -32,7 +32,7 @@ class DiffHistoryBlob implements HistoryBlob { public $mSize = 0; /** - * @var array Array of diffs. If a diff D from A to B is notated D = B - A, + * @var array|null Array of diffs. If a diff D from A to B is notated D = B - A, * and Z is an empty string: * * { item[map[i]] - item[map[i-1]] where i > 0 diff --git a/includes/libs/HashRing.php b/includes/libs/HashRing.php index a59e67dad56..19467e91bba 100644 --- a/includes/libs/HashRing.php +++ b/includes/libs/HashRing.php @@ -51,7 +51,7 @@ class HashRing implements Serializable { /** @var array[] Non-empty position-ordered list of (position, location name) */ protected $baseRing; - /** @var array[] Non-empty position-ordered list of (position, location name) */ + /** @var array[]|null Non-empty position-ordered list of (position, location name) */ protected $liveRing; /** @var integer Overall number of node groups per server */ diff --git a/includes/libs/MappedIterator.php b/includes/libs/MappedIterator.php index 0e53038d544..3fcb2817258 100644 --- a/includes/libs/MappedIterator.php +++ b/includes/libs/MappedIterator.php @@ -28,7 +28,7 @@ class MappedIterator extends FilterIterator { /** @var callable */ protected $vCallback; - /** @var callable */ + /** @var callable|null */ protected $aCallback; /** @var array */ protected $cache = []; diff --git a/includes/libs/ParamValidator/Util/UploadedFileStream.php b/includes/libs/ParamValidator/Util/UploadedFileStream.php index 5c0356e7be4..03b3d1fa3fb 100644 --- a/includes/libs/ParamValidator/Util/UploadedFileStream.php +++ b/includes/libs/ParamValidator/Util/UploadedFileStream.php @@ -19,7 +19,7 @@ use Wikimedia\AtEase\AtEase; */ class UploadedFileStream implements StreamInterface { - /** @var resource File handle */ + /** @var resource|null File handle */ private $fp; /** @var int|false|null File size. False if not set yet. */ diff --git a/includes/libs/filebackend/fileiteration/FSFileBackendList.php b/includes/libs/filebackend/fileiteration/FSFileBackendList.php index 25309e1c395..ead7528b48a 100644 --- a/includes/libs/filebackend/fileiteration/FSFileBackendList.php +++ b/includes/libs/filebackend/fileiteration/FSFileBackendList.php @@ -27,7 +27,7 @@ * @ingroup FileBackend */ abstract class FSFileBackendList implements Iterator { - /** @var Iterator */ + /** @var Iterator|null */ protected $iter; /** @var string */ protected $lastError; diff --git a/includes/libs/rdbms/database/DatabaseSqlite.php b/includes/libs/rdbms/database/DatabaseSqlite.php index 97291d78b7b..024756be918 100644 --- a/includes/libs/rdbms/database/DatabaseSqlite.php +++ b/includes/libs/rdbms/database/DatabaseSqlite.php @@ -44,7 +44,7 @@ class DatabaseSqlite extends Database { /** @var int The number of rows affected as an integer */ protected $lastAffectedRowCount; - /** @var PDO */ + /** @var PDO|null */ protected $conn; /** @var FSLockManager (hopefully on the same server as the DB) */ diff --git a/includes/libs/rdbms/database/resultwrapper/FakeResultWrapper.php b/includes/libs/rdbms/database/resultwrapper/FakeResultWrapper.php index 882aff862ca..c43e26c6698 100644 --- a/includes/libs/rdbms/database/resultwrapper/FakeResultWrapper.php +++ b/includes/libs/rdbms/database/resultwrapper/FakeResultWrapper.php @@ -10,7 +10,7 @@ use stdClass; * doesn't go anywhere near an actual database. */ class FakeResultWrapper extends ResultWrapper { - /** @var stdClass[]|array[] */ + /** @var stdClass[]|array[]|null */ protected $result; /** diff --git a/includes/libs/rdbms/database/resultwrapper/MysqliResultWrapper.php b/includes/libs/rdbms/database/resultwrapper/MysqliResultWrapper.php index 8d8b8a1db18..8573a4bf8b5 100644 --- a/includes/libs/rdbms/database/resultwrapper/MysqliResultWrapper.php +++ b/includes/libs/rdbms/database/resultwrapper/MysqliResultWrapper.php @@ -8,7 +8,7 @@ class MysqliResultWrapper extends ResultWrapper { /** @var DatabaseMysqli */ private $db; - /** @var mysqli_result */ + /** @var mysqli_result|null */ private $result; /** diff --git a/includes/libs/rdbms/database/resultwrapper/SqliteResultWrapper.php b/includes/libs/rdbms/database/resultwrapper/SqliteResultWrapper.php index 4b3db91a8f2..81647542af0 100644 --- a/includes/libs/rdbms/database/resultwrapper/SqliteResultWrapper.php +++ b/includes/libs/rdbms/database/resultwrapper/SqliteResultWrapper.php @@ -7,9 +7,9 @@ use PDO; use PDOStatement; class SqliteResultWrapper extends ResultWrapper { - /** @var PDOStatement */ + /** @var PDOStatement|null */ private $result; - /** @var ArrayIterator */ + /** @var ArrayIterator|null */ private $rows; /** diff --git a/includes/page/ImageHistoryPseudoPager.php b/includes/page/ImageHistoryPseudoPager.php index 46c20afa2d9..f01fa224e4b 100644 --- a/includes/page/ImageHistoryPseudoPager.php +++ b/includes/page/ImageHistoryPseudoPager.php @@ -26,7 +26,7 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager { protected $preventClickjacking = false; /** - * @var File + * @var File|null */ protected $mImg; diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 670ee41ab30..c146607bce9 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -134,7 +134,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord { protected $mDataLoadedFrom = self::READ_NONE; /** - * @var RevisionRecord + * @var RevisionRecord|null */ private $mLastRevision = null; diff --git a/includes/resourceloader/ResourceLoaderImageModule.php b/includes/resourceloader/ResourceLoaderImageModule.php index 480fe37fef9..457ea4126a5 100644 --- a/includes/resourceloader/ResourceLoaderImageModule.php +++ b/includes/resourceloader/ResourceLoaderImageModule.php @@ -27,7 +27,7 @@ use Wikimedia\Minify\CSSMin; * @since 1.25 */ class ResourceLoaderImageModule extends ResourceLoaderModule { - /** @var array */ + /** @var array|null */ protected $definition; /** diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php index 90cd198af34..2825ce75b9c 100644 --- a/includes/search/SearchResultSet.php +++ b/includes/search/SearchResultSet.php @@ -32,7 +32,7 @@ class SearchResultSet extends BaseSearchResultSet { /** * Cache of titles. * Lists titles of the result set, in the same order as results. - * @var Title[] + * @var Title[]|null */ private $titles; diff --git a/includes/specialpage/LoginSignupSpecialPage.php b/includes/specialpage/LoginSignupSpecialPage.php index 5bfc5927381..faa268ca7e7 100644 --- a/includes/specialpage/LoginSignupSpecialPage.php +++ b/includes/specialpage/LoginSignupSpecialPage.php @@ -62,7 +62,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage { /** @var User FIXME another flag for passing data. */ protected $targetUser; - /** @var HTMLForm */ + /** @var HTMLForm|null */ protected $authForm; abstract protected function isSignup(); diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 32587d25277..b83c1d7a2e3 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -44,7 +44,7 @@ class SpecialFileDuplicateSearch extends SpecialPage { private $filename = ''; /** - * @var File selected reference file, if present + * @var File|null selected reference file, if present */ private $file = null; diff --git a/includes/utils/ClassCollector.php b/includes/utils/ClassCollector.php index 3ad63d0d6b3..38b8066e775 100644 --- a/includes/utils/ClassCollector.php +++ b/includes/utils/ClassCollector.php @@ -34,7 +34,7 @@ class ClassCollector { protected $classes; /** - * @var array Token from token_get_all() that started an expect sequence + * @var array|null Token from token_get_all() that started an expect sequence */ protected $startToken; @@ -44,7 +44,7 @@ class ClassCollector { protected $tokens; /** - * @var array Class alias with target/name fields + * @var array|null Class alias with target/name fields */ protected $alias; diff --git a/maintenance/includes/TextPassDumper.php b/maintenance/includes/TextPassDumper.php index 5061837c63f..9adb668f812 100644 --- a/maintenance/includes/TextPassDumper.php +++ b/maintenance/includes/TextPassDumper.php @@ -79,12 +79,12 @@ class TextPassDumper extends BackupDumper { protected $spawnProc = false; /** - * @var resource + * @var resource|null */ protected $spawnWrite; /** - * @var resource + * @var resource|null */ protected $spawnRead;