From: Umherirrender Date: Sat, 13 Jan 2018 00:02:09 +0000 (+0100) Subject: Use ::class to resolve class names in includes files X-Git-Tag: 1.31.0-rc.0~772^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=3124a990a261779bacacc3a32edc63c39073a914;p=lhc%2Fweb%2Fwiklou.git Use ::class to resolve class names in includes files This helps to find renamed or misspelled classes earlier. Phan will check the class names Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 2b2695cdf7..27177cbc7d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1004,15 +1004,15 @@ $wgParserTestMediaHandlers = [ */ $wgContentHandlers = [ // the usual case - CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler', + CONTENT_MODEL_WIKITEXT => WikitextContentHandler::class, // dumb version, no syntax highlighting - CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler', + CONTENT_MODEL_JAVASCRIPT => JavaScriptContentHandler::class, // simple implementation, for use by extensions, etc. - CONTENT_MODEL_JSON => 'JsonContentHandler', + CONTENT_MODEL_JSON => JsonContentHandler::class, // dumb version, no syntax highlighting - CONTENT_MODEL_CSS => 'CssContentHandler', + CONTENT_MODEL_CSS => CssContentHandler::class, // plain text, for use by extensions, etc. - CONTENT_MODEL_TEXT => 'TextContentHandler', + CONTENT_MODEL_TEXT => TextContentHandler::class, ]; /** @@ -1817,7 +1817,7 @@ $wgDBtype = 'mysql'; * Whether to use SSL in DB connection. * * This setting is only used if $wgLBFactoryConf['class'] is set to - * 'LBFactorySimple' and $wgDBservers is an empty array; otherwise + * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise * the DBO_SSL flag must be set in the 'flags' option of the database * connection to achieve the same functionality. */ @@ -1827,7 +1827,7 @@ $wgDBssl = false; * Whether to use compression in DB connection. * * This setting is only used $wgLBFactoryConf['class'] is set to - * 'LBFactorySimple' and $wgDBservers is an empty array; otherwise + * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise * the DBO_COMPRESS flag must be set in the 'flags' option of the database * connection to achieve the same functionality. */ @@ -1998,7 +1998,7 @@ $wgDBservers = false; * The LBFactoryMulti class is provided for this purpose, please see * includes/db/LBFactoryMulti.php for configuration information. */ -$wgLBFactoryConf = [ 'class' => 'LBFactorySimple' ]; +$wgLBFactoryConf = [ 'class' => \Wikimedia\Rdbms\LBFactorySimple::class ]; /** * After a state-changing request is done by a client, this determines @@ -2142,7 +2142,7 @@ $wgExternalStores = []; * ]; * @endcode * - * Used by LBFactorySimple, may be ignored if $wgLBFactoryConf is set to + * Used by \Wikimedia\Rdbms\LBFactorySimple, may be ignored if $wgLBFactoryConf is set to * another class. */ $wgExternalServers = []; @@ -2310,34 +2310,34 @@ $wgLanguageConverterCacheType = CACHE_ANYTHING; * given, giving a callable function which will generate a suitable cache object. */ $wgObjectCaches = [ - CACHE_NONE => [ 'class' => 'EmptyBagOStuff', 'reportDupes' => false ], - CACHE_DB => [ 'class' => 'SqlBagOStuff', 'loggroup' => 'SQLBagOStuff' ], + CACHE_NONE => [ 'class' => EmptyBagOStuff::class, 'reportDupes' => false ], + CACHE_DB => [ 'class' => SqlBagOStuff::class, 'loggroup' => 'SQLBagOStuff' ], CACHE_ANYTHING => [ 'factory' => 'ObjectCache::newAnything' ], CACHE_ACCEL => [ 'factory' => 'ObjectCache::getLocalServerInstance' ], - CACHE_MEMCACHED => [ 'class' => 'MemcachedPhpBagOStuff', 'loggroup' => 'memcached' ], + CACHE_MEMCACHED => [ 'class' => MemcachedPhpBagOStuff::class, 'loggroup' => 'memcached' ], 'db-replicated' => [ - 'class' => 'ReplicatedBagOStuff', + 'class' => ReplicatedBagOStuff::class, 'readFactory' => [ - 'class' => 'SqlBagOStuff', + 'class' => SqlBagOStuff::class, 'args' => [ [ 'slaveOnly' => true ] ] ], 'writeFactory' => [ - 'class' => 'SqlBagOStuff', + 'class' => SqlBagOStuff::class, 'args' => [ [ 'slaveOnly' => false ] ] ], 'loggroup' => 'SQLBagOStuff', 'reportDupes' => false ], - 'apc' => [ 'class' => 'APCBagOStuff', 'reportDupes' => false ], - 'apcu' => [ 'class' => 'APCUBagOStuff', 'reportDupes' => false ], - 'xcache' => [ 'class' => 'XCacheBagOStuff', 'reportDupes' => false ], - 'wincache' => [ 'class' => 'WinCacheBagOStuff', 'reportDupes' => false ], - 'memcached-php' => [ 'class' => 'MemcachedPhpBagOStuff', 'loggroup' => 'memcached' ], - 'memcached-pecl' => [ 'class' => 'MemcachedPeclBagOStuff', 'loggroup' => 'memcached' ], - 'hash' => [ 'class' => 'HashBagOStuff', 'reportDupes' => false ], + 'apc' => [ 'class' => APCBagOStuff::class, 'reportDupes' => false ], + 'apcu' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ], + 'xcache' => [ 'class' => XCacheBagOStuff::class, 'reportDupes' => false ], + 'wincache' => [ 'class' => WinCacheBagOStuff::class, 'reportDupes' => false ], + 'memcached-php' => [ 'class' => MemcachedPhpBagOStuff::class, 'loggroup' => 'memcached' ], + 'memcached-pecl' => [ 'class' => MemcachedPeclBagOStuff::class, 'loggroup' => 'memcached' ], + 'hash' => [ 'class' => HashBagOStuff::class, 'reportDupes' => false ], ]; /** @@ -2374,13 +2374,13 @@ $wgMainWANCache = false; */ $wgWANObjectCaches = [ CACHE_NONE => [ - 'class' => 'WANObjectCache', + 'class' => WANObjectCache::class, 'cacheId' => CACHE_NONE, 'channels' => [] ] /* Example of a simple single data-center cache: 'memcached-php' => [ - 'class' => 'WANObjectCache', + 'class' => WANObjectCache::class, 'cacheId' => 'memcached-php', 'channels' => [ 'purge' => 'wancache-main-memcached-purge' ] ] @@ -2527,7 +2527,7 @@ $wgAdaptiveMessageCache = false; * Use maintenance/rebuildLocalisationCache.php instead. */ $wgLocalisationCacheConf = [ - 'class' => 'LocalisationCache', + 'class' => LocalisationCache::class, 'store' => 'detect', 'storeClass' => false, 'storeDirectory' => false, @@ -4166,8 +4166,8 @@ $wgInvalidRedirectTargets = [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect' ]; * an extension setup function. */ $wgParserConf = [ - 'class' => 'Parser', - # 'preprocessorClass' => 'Preprocessor_Hash', + 'class' => Parser::class, + # 'preprocessorClass' => Preprocessor_Hash::class, ]; /** @@ -4471,7 +4471,7 @@ $wgActiveUserDays = 30; * @since 1.27 */ $wgCentralIdLookupProviders = [ - 'local' => [ 'class' => 'LocalIdLookup' ], + 'local' => [ 'class' => LocalIdLookup::class ], ]; /** @@ -4759,7 +4759,7 @@ $wgPasswordDefault = 'pbkdf2'; * An advanced example: * @code * $wgPasswordConfig['bcrypt-peppered'] = [ - * 'class' => 'EncryptedPassword', + * 'class' => EncryptedPassword::class, * 'underlying' => 'bcrypt', * 'secrets' => [], * 'cipher' => MCRYPT_RIJNDAEL_256, @@ -4772,31 +4772,31 @@ $wgPasswordDefault = 'pbkdf2'; */ $wgPasswordConfig = [ 'A' => [ - 'class' => 'MWOldPassword', + 'class' => MWOldPassword::class, ], 'B' => [ - 'class' => 'MWSaltedPassword', + 'class' => MWSaltedPassword::class, ], 'pbkdf2-legacyA' => [ - 'class' => 'LayeredParameterizedPassword', + 'class' => LayeredParameterizedPassword::class, 'types' => [ 'A', 'pbkdf2', ], ], 'pbkdf2-legacyB' => [ - 'class' => 'LayeredParameterizedPassword', + 'class' => LayeredParameterizedPassword::class, 'types' => [ 'B', 'pbkdf2', ], ], 'bcrypt' => [ - 'class' => 'BcryptPassword', + 'class' => BcryptPassword::class, 'cost' => 9, ], 'pbkdf2' => [ - 'class' => 'Pbkdf2Password', + 'class' => Pbkdf2Password::class, 'algo' => 'sha512', 'cost' => '30000', 'length' => '64', @@ -6106,7 +6106,7 @@ $wgDebugComments = false; * Write SQL queries to the debug log. * * This setting is only used $wgLBFactoryConf['class'] is set to - * 'LBFactorySimple' and $wgDBservers is an empty array; otherwise + * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise * the DBO_DEBUG flag must be set in the 'flags' option of the database * connection to achieve the same functionality. */ @@ -6211,7 +6211,7 @@ $wgDebugLogGroups = []; * * @par To completely disable logging: * @code - * $wgMWLoggerDefaultSpi = [ 'class' => '\\MediaWiki\\Logger\\NullSpi' ]; + * $wgMWLoggerDefaultSpi = [ 'class' => \MediaWiki\Logger\NullSpi::class ]; * @endcode * * @since 1.25 @@ -6219,7 +6219,7 @@ $wgDebugLogGroups = []; * @see MwLogger */ $wgMWLoggerDefaultSpi = [ - 'class' => '\\MediaWiki\\Logger\\LegacySpi', + 'class' => \MediaWiki\Logger\LegacySpi::class, ]; /** @@ -6771,7 +6771,7 @@ $wgRCLinkDays = [ 1, 3, 7, 14, 30 ]; * 'omit_bots' => true, * ]; * @example $wgRCFeeds['example'] = [ - * 'class' => 'ExampleRCFeed', + * 'class' => ExampleRCFeed::class, * ]; * @since 1.22 */ @@ -6783,8 +6783,8 @@ $wgRCFeeds = []; * @since 1.22 */ $wgRCEngines = [ - 'redis' => 'RedisPubSubFeedEngine', - 'udp' => 'UDPRCFeedEngine', + 'redis' => RedisPubSubFeedEngine::class, + 'udp' => UDPRCFeedEngine::class, ]; /** @@ -6908,8 +6908,8 @@ $wgOverrideSiteFeed = []; * $wgOut->isSyndicated() is true. */ $wgFeedClasses = [ - 'rss' => 'RSSFeed', - 'atom' => 'AtomFeed', + 'rss' => RSSFeed::class, + 'atom' => AtomFeed::class, ]; /** @@ -7436,24 +7436,24 @@ $wgServiceWiringFiles = [ * or (since 1.30) a callback to use for creating the job object. */ $wgJobClasses = [ - 'refreshLinks' => 'RefreshLinksJob', - 'deleteLinks' => 'DeleteLinksJob', - 'htmlCacheUpdate' => 'HTMLCacheUpdateJob', - 'sendMail' => 'EmaillingJob', - 'enotifNotify' => 'EnotifNotifyJob', - 'fixDoubleRedirect' => 'DoubleRedirectJob', - 'AssembleUploadChunks' => 'AssembleUploadChunksJob', - 'PublishStashedFile' => 'PublishStashedFileJob', - 'ThumbnailRender' => 'ThumbnailRenderJob', - 'recentChangesUpdate' => 'RecentChangesUpdateJob', - 'refreshLinksPrioritized' => 'RefreshLinksJob', - 'refreshLinksDynamic' => 'RefreshLinksJob', - 'activityUpdateJob' => 'ActivityUpdateJob', - 'categoryMembershipChange' => 'CategoryMembershipChangeJob', - 'clearUserWatchlist' => 'ClearUserWatchlistJob', - 'cdnPurge' => 'CdnPurgeJob', - 'enqueue' => 'EnqueueJob', // local queue for multi-DC setups - 'null' => 'NullJob' + 'refreshLinks' => RefreshLinksJob::class, + 'deleteLinks' => DeleteLinksJob::class, + 'htmlCacheUpdate' => HTMLCacheUpdateJob::class, + 'sendMail' => EmaillingJob::class, + 'enotifNotify' => EnotifNotifyJob::class, + 'fixDoubleRedirect' => DoubleRedirectJob::class, + 'AssembleUploadChunks' => AssembleUploadChunksJob::class, + 'PublishStashedFile' => PublishStashedFileJob::class, + 'ThumbnailRender' => ThumbnailRenderJob::class, + 'recentChangesUpdate' => RecentChangesUpdateJob::class, + 'refreshLinksPrioritized' => RefreshLinksJob::class, + 'refreshLinksDynamic' => RefreshLinksJob::class, + 'activityUpdateJob' => ActivityUpdateJob::class, + 'categoryMembershipChange' => CategoryMembershipChangeJob::class, + 'clearUserWatchlist' => ClearUserWatchlistJob::class, + 'cdnPurge' => CdnPurgeJob::class, + 'enqueue' => EnqueueJob::class, // local queue for multi-DC setups + 'null' => NullJob::class, ]; /** @@ -7502,7 +7502,7 @@ $wgJobSerialCommitThreshold = false; * These settings should be global to all wikis. */ $wgJobTypeConf = [ - 'default' => [ 'class' => 'JobQueueDB', 'order' => 'random', 'claimTTL' => 3600 ], + 'default' => [ 'class' => JobQueueDB::class, 'order' => 'random', 'claimTTL' => 3600 ], ]; /** @@ -7510,7 +7510,7 @@ $wgJobTypeConf = [ * These settings should be global to all wikis. */ $wgJobQueueAggregator = [ - 'class' => 'JobQueueAggregatorNull' + 'class' => JobQueueAggregatorNull::class ]; /** @@ -7531,7 +7531,7 @@ $wgJobQueueIncludeInMaxLagFactor = false; * Expensive Querypages are already updated. */ $wgSpecialPageCacheUpdates = [ - 'Statistics' => [ 'SiteStatsUpdate', 'cacheUpdate' ] + 'Statistics' => [ SiteStatsUpdate::class, 'cacheUpdate' ] ]; /** @@ -7721,42 +7721,42 @@ $wgLogActions = []; * @see LogFormatter */ $wgLogActionsHandlers = [ - 'block/block' => 'BlockLogFormatter', - 'block/reblock' => 'BlockLogFormatter', - 'block/unblock' => 'BlockLogFormatter', - 'contentmodel/change' => 'ContentModelLogFormatter', - 'contentmodel/new' => 'ContentModelLogFormatter', - 'delete/delete' => 'DeleteLogFormatter', - 'delete/delete_redir' => 'DeleteLogFormatter', - 'delete/event' => 'DeleteLogFormatter', - 'delete/restore' => 'DeleteLogFormatter', - 'delete/revision' => 'DeleteLogFormatter', - 'import/interwiki' => 'ImportLogFormatter', - 'import/upload' => 'ImportLogFormatter', - 'managetags/activate' => 'LogFormatter', - 'managetags/create' => 'LogFormatter', - 'managetags/deactivate' => 'LogFormatter', - 'managetags/delete' => 'LogFormatter', - 'merge/merge' => 'MergeLogFormatter', - 'move/move' => 'MoveLogFormatter', - 'move/move_redir' => 'MoveLogFormatter', - 'patrol/patrol' => 'PatrolLogFormatter', - 'patrol/autopatrol' => 'PatrolLogFormatter', - 'protect/modify' => 'ProtectLogFormatter', - 'protect/move_prot' => 'ProtectLogFormatter', - 'protect/protect' => 'ProtectLogFormatter', - 'protect/unprotect' => 'ProtectLogFormatter', - 'rights/autopromote' => 'RightsLogFormatter', - 'rights/rights' => 'RightsLogFormatter', - 'suppress/block' => 'BlockLogFormatter', - 'suppress/delete' => 'DeleteLogFormatter', - 'suppress/event' => 'DeleteLogFormatter', - 'suppress/reblock' => 'BlockLogFormatter', - 'suppress/revision' => 'DeleteLogFormatter', - 'tag/update' => 'TagLogFormatter', - 'upload/overwrite' => 'UploadLogFormatter', - 'upload/revert' => 'UploadLogFormatter', - 'upload/upload' => 'UploadLogFormatter', + 'block/block' => BlockLogFormatter::class, + 'block/reblock' => BlockLogFormatter::class, + 'block/unblock' => BlockLogFormatter::class, + 'contentmodel/change' => ContentModelLogFormatter::class, + 'contentmodel/new' => ContentModelLogFormatter::class, + 'delete/delete' => DeleteLogFormatter::class, + 'delete/delete_redir' => DeleteLogFormatter::class, + 'delete/event' => DeleteLogFormatter::class, + 'delete/restore' => DeleteLogFormatter::class, + 'delete/revision' => DeleteLogFormatter::class, + 'import/interwiki' => ImportLogFormatter::class, + 'import/upload' => ImportLogFormatter::class, + 'managetags/activate' => LogFormatter::class, + 'managetags/create' => LogFormatter::class, + 'managetags/deactivate' => LogFormatter::class, + 'managetags/delete' => LogFormatter::class, + 'merge/merge' => MergeLogFormatter::class, + 'move/move' => MoveLogFormatter::class, + 'move/move_redir' => MoveLogFormatter::class, + 'patrol/patrol' => PatrolLogFormatter::class, + 'patrol/autopatrol' => PatrolLogFormatter::class, + 'protect/modify' => ProtectLogFormatter::class, + 'protect/move_prot' => ProtectLogFormatter::class, + 'protect/protect' => ProtectLogFormatter::class, + 'protect/unprotect' => ProtectLogFormatter::class, + 'rights/autopromote' => RightsLogFormatter::class, + 'rights/rights' => RightsLogFormatter::class, + 'suppress/block' => BlockLogFormatter::class, + 'suppress/delete' => DeleteLogFormatter::class, + 'suppress/event' => DeleteLogFormatter::class, + 'suppress/reblock' => BlockLogFormatter::class, + 'suppress/revision' => DeleteLogFormatter::class, + 'tag/update' => TagLogFormatter::class, + 'upload/overwrite' => UploadLogFormatter::class, + 'upload/revert' => UploadLogFormatter::class, + 'upload/upload' => UploadLogFormatter::class, ]; /** @@ -7887,7 +7887,7 @@ $wgActions = [ 'credits' => true, 'delete' => true, 'edit' => true, - 'editchangetags' => 'SpecialPageAction', + 'editchangetags' => SpecialPageAction::class, 'history' => true, 'info' => true, 'markpatrolled' => true, @@ -7896,7 +7896,7 @@ $wgActions = [ 'raw' => true, 'render' => true, 'revert' => true, - 'revisiondelete' => 'SpecialPageAction', + 'revisiondelete' => SpecialPageAction::class, 'rollback' => true, 'submit' => true, 'unprotect' => true, @@ -8045,12 +8045,12 @@ $wgDebugAPI = false; * @code * $wgAPIModules['foo'] = 'ApiFoo'; * $wgAPIModules['bar'] = [ - * 'class' => 'ApiBar', + * 'class' => ApiBar::class, * 'factory' => function( $main, $name ) { ... } * ]; * $wgAPIModules['xyzzy'] = [ - * 'class' => 'ApiXyzzy', - * 'factory' => [ 'XyzzyFactory', 'newApiModule' ] + * 'class' => ApiXyzzy::class, + * 'factory' => [ XyzzyFactory::class, 'newApiModule' ] * ]; * @endcode * @@ -8473,7 +8473,7 @@ $wgRedirectOnLogin = null; * @par Example using local redis instance: * @code * $wgPoolCounterConf = [ 'ArticleView' => [ - * 'class' => 'PoolCounterRedis', + * 'class' => PoolCounterRedis::class, * 'timeout' => 15, // wait timeout in seconds * 'workers' => 1, // maximum number of active threads in each pool * 'maxqueue' => 5, // maximum number of total threads in each pool @@ -8485,7 +8485,7 @@ $wgRedirectOnLogin = null; * @par Example using C daemon from https://www.mediawiki.org/wiki/Extension:PoolCounter: * @code * $wgPoolCounterConf = [ 'ArticleView' => [ - * 'class' => 'PoolCounter_Client', + * 'class' => PoolCounter_Client::class, * 'timeout' => 15, // wait timeout in seconds * 'workers' => 5, // maximum number of active threads in each pool * 'maxqueue' => 50, // maximum number of total threads in each pool @@ -8559,7 +8559,7 @@ $wgTextModelsToParse = [ * @since 1.20 */ $wgSiteTypes = [ - 'mediawiki' => 'MediaWikiSite', + 'mediawiki' => MediaWikiSite::class, ]; /** @@ -8633,7 +8633,7 @@ $wgPageLanguageUseDB = false; * Auto-mounting example for Parsoid: * * $wgVirtualRestConfig['paths']['/parsoid/'] = [ - * 'class' => 'ParsoidVirtualRESTService', + * 'class' => ParsoidVirtualRESTService::class, * 'options' => [ * 'url' => 'http://localhost:8000', * 'prefix' => 'enwiki', @@ -8730,7 +8730,7 @@ $wgMaxJobDBWriteDuration = false; */ $wgEventRelayerConfig = [ 'default' => [ - 'class' => 'EventRelayerNull', + 'class' => EventRelayerNull::class, ] ]; diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index 075b48d225..26a6d45bf8 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -707,7 +707,7 @@ if ( false ) { // autoload entries for the lowercase variants of these classes (T166759). // The code below is never executed, but it is picked up by the AutoloadGenerator // parser, which scans for class_alias() calls. - class_alias( 'ConcatenatedGzipHistoryBlob', 'concatenatedgziphistoryblob' ); - class_alias( 'HistoryBlobCurStub', 'historyblobcurstub' ); - class_alias( 'HistoryBlobStub', 'historyblobstub' ); + class_alias( ConcatenatedGzipHistoryBlob::class, 'concatenatedgziphistoryblob' ); + class_alias( HistoryBlobCurStub::class, 'historyblobcurstub' ); + class_alias( HistoryBlobStub::class, 'historyblobstub' ); } diff --git a/includes/Preferences.php b/includes/Preferences.php index f65b2ce15e..26e28baf47 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -267,7 +267,7 @@ class Preferences { public static function getFormObject( $user, IContextSource $context, - $formClass = 'PreferencesForm', + $formClass = PreferencesForm::class, array $remove = [] ) { $preferencesFactory = self::getDefaultPreferencesFactory(); diff --git a/includes/Setup.php b/includes/Setup.php index 3e37c9c9c1..01f67c8caf 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -249,12 +249,12 @@ $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; */ $wgLockManagers[] = [ 'name' => 'fsLockManager', - 'class' => 'FSLockManager', + 'class' => FSLockManager::class, 'lockDirectory' => "{$wgUploadDirectory}/lockdir", ]; $wgLockManagers[] = [ 'name' => 'nullLockManager', - 'class' => 'NullLockManager', + 'class' => NullLockManager::class, ]; /** @@ -276,7 +276,7 @@ $wgGalleryOptions += [ */ if ( !$wgLocalFileRepo ) { $wgLocalFileRepo = [ - 'class' => 'LocalRepo', + 'class' => LocalRepo::class, 'name' => 'local', 'directory' => $wgUploadDirectory, 'scriptDirUrl' => $wgScriptPath, @@ -295,7 +295,7 @@ if ( !$wgLocalFileRepo ) { if ( $wgUseSharedUploads ) { if ( $wgSharedUploadDBname ) { $wgForeignFileRepos[] = [ - 'class' => 'ForeignDBRepo', + 'class' => ForeignDBRepo::class, 'name' => 'shared', 'directory' => $wgSharedUploadDirectory, 'url' => $wgSharedUploadPath, @@ -315,7 +315,7 @@ if ( $wgUseSharedUploads ) { ]; } else { $wgForeignFileRepos[] = [ - 'class' => 'FileRepo', + 'class' => FileRepo::class, 'name' => 'shared', 'directory' => $wgSharedUploadDirectory, 'url' => $wgSharedUploadPath, @@ -329,7 +329,7 @@ if ( $wgUseSharedUploads ) { } if ( $wgUseInstantCommons ) { $wgForeignFileRepos[] = [ - 'class' => 'ForeignAPIRepo', + 'class' => ForeignAPIRepo::class, 'name' => 'wikimediacommons', 'apibase' => 'https://commons.wikimedia.org/w/api.php', 'url' => 'https://upload.wikimedia.org/wikipedia/commons', @@ -349,7 +349,7 @@ if ( !isset( $wgLocalFileRepo['backend'] ) ) { $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend'; } foreach ( $wgForeignFileRepos as &$repo ) { - if ( !isset( $repo['directory'] ) && $repo['class'] === 'ForeignAPIRepo' ) { + if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) { $repo['directory'] = $wgUploadDirectory; // b/c } if ( !isset( $repo['backend'] ) ) { @@ -538,16 +538,16 @@ if ( $wgNewUserLog ) { $wgLogTypes[] = 'newusers'; $wgLogNames['newusers'] = 'newuserlogpage'; $wgLogHeaders['newusers'] = 'newuserlogpagetext'; - $wgLogActionsHandlers['newusers/newusers'] = 'NewUsersLogFormatter'; - $wgLogActionsHandlers['newusers/create'] = 'NewUsersLogFormatter'; - $wgLogActionsHandlers['newusers/create2'] = 'NewUsersLogFormatter'; - $wgLogActionsHandlers['newusers/byemail'] = 'NewUsersLogFormatter'; - $wgLogActionsHandlers['newusers/autocreate'] = 'NewUsersLogFormatter'; + $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class; + $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class; + $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class; + $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class; + $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class; } if ( $wgPageLanguageUseDB ) { $wgLogTypes[] = 'pagelang'; - $wgLogActionsHandlers['pagelang/pagelang'] = 'PageLangLogFormatter'; + $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class; } if ( $wgCookieSecure === 'detect' ) { @@ -698,7 +698,7 @@ if ( $wgMainWANCache === false ) { // Sites using multiple datacenters can configure a relayer. $wgMainWANCache = 'mediawiki-main-default'; $wgWANObjectCaches[$wgMainWANCache] = [ - 'class' => 'WANObjectCache', + 'class' => WANObjectCache::class, 'cacheId' => $wgMainCacheType, 'channels' => [ 'purge' => 'wancache-main-default-purge' ] ]; diff --git a/includes/WebRequest.php b/includes/WebRequest.php index cd62737c56..7bfb5a43e4 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -956,7 +956,7 @@ class WebRequest { public function response() { /* Lazy initialization of response object for this request */ if ( !is_object( $this->response ) ) { - $class = ( $this instanceof FauxRequest ) ? 'FauxResponse' : 'WebResponse'; + $class = ( $this instanceof FauxRequest ) ? FauxResponse::class : WebResponse::class; $this->response = new $class(); } return $this->response; diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 5056b6def7..2c2dd9ab23 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -55,72 +55,72 @@ class ApiMain extends ApiBase { * List of available modules: action name => module class */ private static $Modules = [ - 'login' => 'ApiLogin', - 'clientlogin' => 'ApiClientLogin', - 'logout' => 'ApiLogout', - 'createaccount' => 'ApiAMCreateAccount', - 'linkaccount' => 'ApiLinkAccount', - 'unlinkaccount' => 'ApiRemoveAuthenticationData', - 'changeauthenticationdata' => 'ApiChangeAuthenticationData', - 'removeauthenticationdata' => 'ApiRemoveAuthenticationData', - 'resetpassword' => 'ApiResetPassword', - 'query' => 'ApiQuery', - 'expandtemplates' => 'ApiExpandTemplates', - 'parse' => 'ApiParse', - 'stashedit' => 'ApiStashEdit', - 'opensearch' => 'ApiOpenSearch', - 'feedcontributions' => 'ApiFeedContributions', - 'feedrecentchanges' => 'ApiFeedRecentChanges', - 'feedwatchlist' => 'ApiFeedWatchlist', - 'help' => 'ApiHelp', - 'paraminfo' => 'ApiParamInfo', - 'rsd' => 'ApiRsd', - 'compare' => 'ApiComparePages', - 'tokens' => 'ApiTokens', - 'checktoken' => 'ApiCheckToken', - 'cspreport' => 'ApiCSPReport', - 'validatepassword' => 'ApiValidatePassword', + 'login' => ApiLogin::class, + 'clientlogin' => ApiClientLogin::class, + 'logout' => ApiLogout::class, + 'createaccount' => ApiAMCreateAccount::class, + 'linkaccount' => ApiLinkAccount::class, + 'unlinkaccount' => ApiRemoveAuthenticationData::class, + 'changeauthenticationdata' => ApiChangeAuthenticationData::class, + 'removeauthenticationdata' => ApiRemoveAuthenticationData::class, + 'resetpassword' => ApiResetPassword::class, + 'query' => ApiQuery::class, + 'expandtemplates' => ApiExpandTemplates::class, + 'parse' => ApiParse::class, + 'stashedit' => ApiStashEdit::class, + 'opensearch' => ApiOpenSearch::class, + 'feedcontributions' => ApiFeedContributions::class, + 'feedrecentchanges' => ApiFeedRecentChanges::class, + 'feedwatchlist' => ApiFeedWatchlist::class, + 'help' => ApiHelp::class, + 'paraminfo' => ApiParamInfo::class, + 'rsd' => ApiRsd::class, + 'compare' => ApiComparePages::class, + 'tokens' => ApiTokens::class, + 'checktoken' => ApiCheckToken::class, + 'cspreport' => ApiCSPReport::class, + 'validatepassword' => ApiValidatePassword::class, // Write modules - 'purge' => 'ApiPurge', - 'setnotificationtimestamp' => 'ApiSetNotificationTimestamp', - 'rollback' => 'ApiRollback', - 'delete' => 'ApiDelete', - 'undelete' => 'ApiUndelete', - 'protect' => 'ApiProtect', - 'block' => 'ApiBlock', - 'unblock' => 'ApiUnblock', - 'move' => 'ApiMove', - 'edit' => 'ApiEditPage', - 'upload' => 'ApiUpload', - 'filerevert' => 'ApiFileRevert', - 'emailuser' => 'ApiEmailUser', - 'watch' => 'ApiWatch', - 'patrol' => 'ApiPatrol', - 'import' => 'ApiImport', - 'clearhasmsg' => 'ApiClearHasMsg', - 'userrights' => 'ApiUserrights', - 'options' => 'ApiOptions', - 'imagerotate' => 'ApiImageRotate', - 'revisiondelete' => 'ApiRevisionDelete', - 'managetags' => 'ApiManageTags', - 'tag' => 'ApiTag', - 'mergehistory' => 'ApiMergeHistory', - 'setpagelanguage' => 'ApiSetPageLanguage', + 'purge' => ApiPurge::class, + 'setnotificationtimestamp' => ApiSetNotificationTimestamp::class, + 'rollback' => ApiRollback::class, + 'delete' => ApiDelete::class, + 'undelete' => ApiUndelete::class, + 'protect' => ApiProtect::class, + 'block' => ApiBlock::class, + 'unblock' => ApiUnblock::class, + 'move' => ApiMove::class, + 'edit' => ApiEditPage::class, + 'upload' => ApiUpload::class, + 'filerevert' => ApiFileRevert::class, + 'emailuser' => ApiEmailUser::class, + 'watch' => ApiWatch::class, + 'patrol' => ApiPatrol::class, + 'import' => ApiImport::class, + 'clearhasmsg' => ApiClearHasMsg::class, + 'userrights' => ApiUserrights::class, + 'options' => ApiOptions::class, + 'imagerotate' => ApiImageRotate::class, + 'revisiondelete' => ApiRevisionDelete::class, + 'managetags' => ApiManageTags::class, + 'tag' => ApiTag::class, + 'mergehistory' => ApiMergeHistory::class, + 'setpagelanguage' => ApiSetPageLanguage::class, ]; /** * List of available formats: format name => format class */ private static $Formats = [ - 'json' => 'ApiFormatJson', - 'jsonfm' => 'ApiFormatJson', - 'php' => 'ApiFormatPhp', - 'phpfm' => 'ApiFormatPhp', - 'xml' => 'ApiFormatXml', - 'xmlfm' => 'ApiFormatXml', - 'rawfm' => 'ApiFormatJson', - 'none' => 'ApiFormatNone', + 'json' => ApiFormatJson::class, + 'jsonfm' => ApiFormatJson::class, + 'php' => ApiFormatPhp::class, + 'phpfm' => ApiFormatPhp::class, + 'xml' => ApiFormatXml::class, + 'xmlfm' => ApiFormatXml::class, + 'rawfm' => ApiFormatJson::class, + 'none' => ApiFormatNone::class, ]; /** diff --git a/includes/api/ApiModuleManager.php b/includes/api/ApiModuleManager.php index 2619a7c858..e02c862778 100644 --- a/includes/api/ApiModuleManager.php +++ b/includes/api/ApiModuleManager.php @@ -78,12 +78,12 @@ class ApiModuleManager extends ContextSource { * @code * $modules['foo'] = 'ApiFoo'; * $modules['bar'] = [ - * 'class' => 'ApiBar', + * 'class' => ApiBar::class, * 'factory' => function( $main, $name ) { ... } * ]; * $modules['xyzzy'] = [ - * 'class' => 'ApiXyzzy', - * 'factory' => [ 'XyzzyFactory', 'newApiModule' ] + * 'class' => ApiXyzzy::class, + * 'factory' => [ XyzzyFactory::class, 'newApiModule' ] * ]; * @endcode * diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index 30611b630f..48303a5748 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -1528,7 +1528,7 @@ class ApiPageSet extends ApiBase { $prefix = $query->getModulePath() . '+'; $mgr = $query->getModuleManager(); foreach ( $mgr->getNamesWithClasses() as $name => $class ) { - if ( is_subclass_of( $class, 'ApiQueryGeneratorBase' ) ) { + if ( is_subclass_of( $class, ApiQueryGeneratorBase::class ) ) { $gens[$name] = $prefix . $name; } } diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 5bbd21176e..e49024d1ed 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -40,26 +40,26 @@ class ApiQuery extends ApiBase { * @var array */ private static $QueryPropModules = [ - 'categories' => 'ApiQueryCategories', - 'categoryinfo' => 'ApiQueryCategoryInfo', - 'contributors' => 'ApiQueryContributors', - 'deletedrevisions' => 'ApiQueryDeletedRevisions', - 'duplicatefiles' => 'ApiQueryDuplicateFiles', - 'extlinks' => 'ApiQueryExternalLinks', - 'fileusage' => 'ApiQueryBacklinksprop', - 'images' => 'ApiQueryImages', - 'imageinfo' => 'ApiQueryImageInfo', - 'info' => 'ApiQueryInfo', - 'links' => 'ApiQueryLinks', - 'linkshere' => 'ApiQueryBacklinksprop', - 'iwlinks' => 'ApiQueryIWLinks', - 'langlinks' => 'ApiQueryLangLinks', - 'pageprops' => 'ApiQueryPageProps', - 'redirects' => 'ApiQueryBacklinksprop', - 'revisions' => 'ApiQueryRevisions', - 'stashimageinfo' => 'ApiQueryStashImageInfo', - 'templates' => 'ApiQueryLinks', - 'transcludedin' => 'ApiQueryBacklinksprop', + 'categories' => ApiQueryCategories::class, + 'categoryinfo' => ApiQueryCategoryInfo::class, + 'contributors' => ApiQueryContributors::class, + 'deletedrevisions' => ApiQueryDeletedRevisions::class, + 'duplicatefiles' => ApiQueryDuplicateFiles::class, + 'extlinks' => ApiQueryExternalLinks::class, + 'fileusage' => ApiQueryBacklinksprop::class, + 'images' => ApiQueryImages::class, + 'imageinfo' => ApiQueryImageInfo::class, + 'info' => ApiQueryInfo::class, + 'links' => ApiQueryLinks::class, + 'linkshere' => ApiQueryBacklinksprop::class, + 'iwlinks' => ApiQueryIWLinks::class, + 'langlinks' => ApiQueryLangLinks::class, + 'pageprops' => ApiQueryPageProps::class, + 'redirects' => ApiQueryBacklinksprop::class, + 'revisions' => ApiQueryRevisions::class, + 'stashimageinfo' => ApiQueryStashImageInfo::class, + 'templates' => ApiQueryLinks::class, + 'transcludedin' => ApiQueryBacklinksprop::class, ]; /** @@ -67,41 +67,41 @@ class ApiQuery extends ApiBase { * @var array */ private static $QueryListModules = [ - 'allcategories' => 'ApiQueryAllCategories', - 'alldeletedrevisions' => 'ApiQueryAllDeletedRevisions', - 'allfileusages' => 'ApiQueryAllLinks', - 'allimages' => 'ApiQueryAllImages', - 'alllinks' => 'ApiQueryAllLinks', - 'allpages' => 'ApiQueryAllPages', - 'allredirects' => 'ApiQueryAllLinks', - 'allrevisions' => 'ApiQueryAllRevisions', - 'mystashedfiles' => 'ApiQueryMyStashedFiles', - 'alltransclusions' => 'ApiQueryAllLinks', - 'allusers' => 'ApiQueryAllUsers', - 'backlinks' => 'ApiQueryBacklinks', - 'blocks' => 'ApiQueryBlocks', - 'categorymembers' => 'ApiQueryCategoryMembers', - 'deletedrevs' => 'ApiQueryDeletedrevs', - 'embeddedin' => 'ApiQueryBacklinks', - 'exturlusage' => 'ApiQueryExtLinksUsage', - 'filearchive' => 'ApiQueryFilearchive', - 'imageusage' => 'ApiQueryBacklinks', - 'iwbacklinks' => 'ApiQueryIWBacklinks', - 'langbacklinks' => 'ApiQueryLangBacklinks', - 'logevents' => 'ApiQueryLogEvents', - 'pageswithprop' => 'ApiQueryPagesWithProp', - 'pagepropnames' => 'ApiQueryPagePropNames', - 'prefixsearch' => 'ApiQueryPrefixSearch', - 'protectedtitles' => 'ApiQueryProtectedTitles', - 'querypage' => 'ApiQueryQueryPage', - 'random' => 'ApiQueryRandom', - 'recentchanges' => 'ApiQueryRecentChanges', - 'search' => 'ApiQuerySearch', - 'tags' => 'ApiQueryTags', - 'usercontribs' => 'ApiQueryContributions', - 'users' => 'ApiQueryUsers', - 'watchlist' => 'ApiQueryWatchlist', - 'watchlistraw' => 'ApiQueryWatchlistRaw', + 'allcategories' => ApiQueryAllCategories::class, + 'alldeletedrevisions' => ApiQueryAllDeletedRevisions::class, + 'allfileusages' => ApiQueryAllLinks::class, + 'allimages' => ApiQueryAllImages::class, + 'alllinks' => ApiQueryAllLinks::class, + 'allpages' => ApiQueryAllPages::class, + 'allredirects' => ApiQueryAllLinks::class, + 'allrevisions' => ApiQueryAllRevisions::class, + 'mystashedfiles' => ApiQueryMyStashedFiles::class, + 'alltransclusions' => ApiQueryAllLinks::class, + 'allusers' => ApiQueryAllUsers::class, + 'backlinks' => ApiQueryBacklinks::class, + 'blocks' => ApiQueryBlocks::class, + 'categorymembers' => ApiQueryCategoryMembers::class, + 'deletedrevs' => ApiQueryDeletedrevs::class, + 'embeddedin' => ApiQueryBacklinks::class, + 'exturlusage' => ApiQueryExtLinksUsage::class, + 'filearchive' => ApiQueryFilearchive::class, + 'imageusage' => ApiQueryBacklinks::class, + 'iwbacklinks' => ApiQueryIWBacklinks::class, + 'langbacklinks' => ApiQueryLangBacklinks::class, + 'logevents' => ApiQueryLogEvents::class, + 'pageswithprop' => ApiQueryPagesWithProp::class, + 'pagepropnames' => ApiQueryPagePropNames::class, + 'prefixsearch' => ApiQueryPrefixSearch::class, + 'protectedtitles' => ApiQueryProtectedTitles::class, + 'querypage' => ApiQueryQueryPage::class, + 'random' => ApiQueryRandom::class, + 'recentchanges' => ApiQueryRecentChanges::class, + 'search' => ApiQuerySearch::class, + 'tags' => ApiQueryTags::class, + 'usercontribs' => ApiQueryContributions::class, + 'users' => ApiQueryUsers::class, + 'watchlist' => ApiQueryWatchlist::class, + 'watchlistraw' => ApiQueryWatchlistRaw::class, ]; /** @@ -109,12 +109,12 @@ class ApiQuery extends ApiBase { * @var array */ private static $QueryMetaModules = [ - 'allmessages' => 'ApiQueryAllMessages', - 'authmanagerinfo' => 'ApiQueryAuthManagerInfo', - 'siteinfo' => 'ApiQuerySiteinfo', - 'userinfo' => 'ApiQueryUserInfo', - 'filerepoinfo' => 'ApiQueryFileRepoInfo', - 'tokens' => 'ApiQueryTokens', + 'allmessages' => ApiQueryAllMessages::class, + 'authmanagerinfo' => ApiQueryAuthManagerInfo::class, + 'siteinfo' => ApiQuerySiteinfo::class, + 'userinfo' => ApiQueryUserInfo::class, + 'filerepoinfo' => ApiQueryFileRepoInfo::class, + 'tokens' => ApiQueryTokens::class, ]; /** diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 23a327b15a..5294b1d8e7 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -103,15 +103,15 @@ class ApiQueryInfo extends ApiQueryBase { } $this->tokenFunctions = [ - 'edit' => [ 'ApiQueryInfo', 'getEditToken' ], - 'delete' => [ 'ApiQueryInfo', 'getDeleteToken' ], - 'protect' => [ 'ApiQueryInfo', 'getProtectToken' ], - 'move' => [ 'ApiQueryInfo', 'getMoveToken' ], - 'block' => [ 'ApiQueryInfo', 'getBlockToken' ], - 'unblock' => [ 'ApiQueryInfo', 'getUnblockToken' ], - 'email' => [ 'ApiQueryInfo', 'getEmailToken' ], - 'import' => [ 'ApiQueryInfo', 'getImportToken' ], - 'watch' => [ 'ApiQueryInfo', 'getWatchToken' ], + 'edit' => [ self::class, 'getEditToken' ], + 'delete' => [ self::class, 'getDeleteToken' ], + 'protect' => [ self::class, 'getProtectToken' ], + 'move' => [ self::class, 'getMoveToken' ], + 'block' => [ self::class, 'getBlockToken' ], + 'unblock' => [ self::class, 'getUnblockToken' ], + 'email' => [ self::class, 'getEmailToken' ], + 'import' => [ self::class, 'getImportToken' ], + 'watch' => [ self::class, 'getWatchToken' ], ]; Hooks::run( 'APIQueryInfoTokens', [ &$this->tokenFunctions ] ); @@ -314,7 +314,7 @@ class ApiQueryInfo extends ApiQueryBase { $this->everything = $this->titles + $this->missing; $result = $this->getResult(); - uasort( $this->everything, [ 'Title', 'compare' ] ); + uasort( $this->everything, [ Title::class, 'compare' ] ); if ( !is_null( $this->params['continue'] ) ) { // Throw away any titles we're gonna skip so they don't // clutter queries diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 4549987434..517cf1f860 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -61,7 +61,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { } $this->tokenFunctions = [ - 'patrol' => [ 'ApiQueryRecentChanges', 'getPatrolToken' ] + 'patrol' => [ self::class, 'getPatrolToken' ] ]; Hooks::run( 'APIQueryRecentChangesTokens', [ &$this->tokenFunctions ] ); diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index aa9a39c1cb..ef0223aae5 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -56,7 +56,7 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase { } $this->tokenFunctions = [ - 'rollback' => [ 'ApiQueryRevisions', 'getRollbackToken' ] + 'rollback' => [ self::class, 'getRollbackToken' ] ]; Hooks::run( 'APIQueryRevisionsTokens', [ &$this->tokenFunctions ] ); diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index acae8899e5..f924736de0 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -848,7 +848,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { foreach ( $myWgHooks as $name => $subscribers ) { $arr = [ 'name' => $name, - 'subscribers' => array_map( [ 'SpecialVersion', 'arrayToString' ], $subscribers ), + 'subscribers' => array_map( [ SpecialVersion::class, 'arrayToString' ], $subscribers ), ]; ApiResult::setArrayType( $arr['subscribers'], 'array' ); diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 9261003bc7..6de512b878 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -73,7 +73,7 @@ class ApiQueryUsers extends ApiQueryBase { } $this->tokenFunctions = [ - 'userrights' => [ 'ApiQueryUsers', 'getUserrightsToken' ], + 'userrights' => [ self::class, 'getUserrightsToken' ], ]; Hooks::run( 'APIQueryUsersTokens', [ &$this->tokenFunctions ] ); diff --git a/includes/api/ApiTokens.php b/includes/api/ApiTokens.php index 606967d64c..ff1914c870 100644 --- a/includes/api/ApiTokens.php +++ b/includes/api/ApiTokens.php @@ -62,11 +62,11 @@ class ApiTokens extends ApiBase { if ( $types ) { return $types; } - $types = [ 'patrol' => [ 'ApiQueryRecentChanges', 'getPatrolToken' ] ]; + $types = [ 'patrol' => [ ApiQueryRecentChanges::class, 'getPatrolToken' ] ]; $names = [ 'edit', 'delete', 'protect', 'move', 'block', 'unblock', 'email', 'import', 'watch', 'options' ]; foreach ( $names as $name ) { - $types[$name] = [ 'ApiQueryInfo', 'get' . ucfirst( $name ) . 'Token' ]; + $types[$name] = [ ApiQueryInfo::class, 'get' . ucfirst( $name ) . 'Token' ]; } Hooks::run( 'ApiTokensGetTokenTypes', [ &$types ] ); diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index e8a2061e9a..93e432b951 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -724,26 +724,26 @@ class ApiUpload extends ApiBase { */ protected function handleStashException( $e ) { switch ( get_class( $e ) ) { - case 'UploadStashFileNotFoundException': + case UploadStashFileNotFoundException::class: $wrap = 'apierror-stashedfilenotfound'; break; - case 'UploadStashBadPathException': + case UploadStashBadPathException::class: $wrap = 'apierror-stashpathinvalid'; break; - case 'UploadStashFileException': + case UploadStashFileException::class: $wrap = 'apierror-stashfilestorage'; break; - case 'UploadStashZeroLengthFileException': + case UploadStashZeroLengthFileException::class: $wrap = 'apierror-stashzerolength'; break; - case 'UploadStashNotLoggedInException': + case UploadStashNotLoggedInException::class: return StatusValue::newFatal( ApiMessage::create( [ 'apierror-mustbeloggedin', $this->msg( 'action-upload' ) ], 'stashnotloggedin' ) ); - case 'UploadStashWrongOwnerException': + case UploadStashWrongOwnerException::class: $wrap = 'apierror-stashwrongowner'; break; - case 'UploadStashNoSuchKeyException': + case UploadStashNoSuchKeyException::class: $wrap = 'apierror-stashnosuchfilekey'; break; default: diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 48721866aa..c9615b1335 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -1126,7 +1126,7 @@ class MessageCache { $wgParser->firstCallInit(); # Clone it and store it $class = $wgParserConf['class']; - if ( $class == 'ParserDiffTest' ) { + if ( $class == ParserDiffTest::class ) { # Uncloneable $this->mParser = new $class( $wgParserConf ); } else { diff --git a/includes/cache/localisation/LocalisationCache.php b/includes/cache/localisation/LocalisationCache.php index 5e0a688e81..26382aab1e 100644 --- a/includes/cache/localisation/LocalisationCache.php +++ b/includes/cache/localisation/LocalisationCache.php @@ -199,22 +199,22 @@ class LocalisationCache { switch ( $conf['store'] ) { case 'files': case 'file': - $storeClass = 'LCStoreCDB'; + $storeClass = LCStoreCDB::class; break; case 'db': - $storeClass = 'LCStoreDB'; + $storeClass = LCStoreDB::class; break; case 'array': - $storeClass = 'LCStoreStaticArray'; + $storeClass = LCStoreStaticArray::class; break; case 'detect': if ( !empty( $conf['storeDirectory'] ) ) { - $storeClass = 'LCStoreCDB'; + $storeClass = LCStoreCDB::class; } elseif ( $wgCacheDirectory ) { $storeConf['directory'] = $wgCacheDirectory; - $storeClass = 'LCStoreCDB'; + $storeClass = LCStoreCDB::class; } else { - $storeClass = 'LCStoreDB'; + $storeClass = LCStoreDB::class; } break; default: diff --git a/includes/changes/CategoryMembershipChange.php b/includes/changes/CategoryMembershipChange.php index 6fa6907007..f095b64f82 100644 --- a/includes/changes/CategoryMembershipChange.php +++ b/includes/changes/CategoryMembershipChange.php @@ -71,7 +71,7 @@ class CategoryMembershipChange { $this->timestamp = $revision->getTimestamp(); } $this->revision = $revision; - $this->newForCategorizationCallback = [ 'RecentChange', 'newForCategorization' ]; + $this->newForCategorizationCallback = [ RecentChange::class, 'newForCategorization' ]; } /** diff --git a/includes/changetags/ChangeTagsList.php b/includes/changetags/ChangeTagsList.php index afbbb2bf5b..1559e1d6f7 100644 --- a/includes/changetags/ChangeTagsList.php +++ b/includes/changetags/ChangeTagsList.php @@ -43,10 +43,10 @@ abstract class ChangeTagsList extends RevisionListBase { ) { switch ( $typeName ) { case 'revision': - $className = 'ChangeTagsRevisionList'; + $className = ChangeTagsRevisionList::class; break; case 'logentry': - $className = 'ChangeTagsLogList'; + $className = ChangeTagsLogList::class; break; default: throw new Exception( "Class $typeName requested, but does not exist" ); diff --git a/includes/db/MWLBFactory.php b/includes/db/MWLBFactory.php index aa1918d51f..8d1f4762bc 100644 --- a/includes/db/MWLBFactory.php +++ b/includes/db/MWLBFactory.php @@ -64,7 +64,7 @@ abstract class MWLBFactory { // When making changes here, remember to also specify MediaWiki-specific options // for Database classes in the relevant Installer subclass. // Such as MysqlInstaller::openConnection and PostgresInstaller::openConnectionWithParams. - if ( $lbConf['class'] === 'LBFactorySimple' ) { + if ( $lbConf['class'] === Wikimedia\Rdbms\LBFactorySimple::class ) { if ( isset( $lbConf['servers'] ) ) { // Server array is already explicitly configured; leave alone } elseif ( is_array( $mainConfig->get( 'DBservers' ) ) ) { @@ -132,7 +132,7 @@ abstract class MWLBFactory { if ( !isset( $lbConf['externalClusters'] ) ) { $lbConf['externalClusters'] = $mainConfig->get( 'ExternalServers' ); } - } elseif ( $lbConf['class'] === 'LBFactoryMulti' ) { + } elseif ( $lbConf['class'] === Wikimedia\Rdbms\LBFactoryMulti::class ) { if ( isset( $lbConf['serverTemplate'] ) ) { if ( in_array( $lbConf['serverTemplate']['type'], $typesWithSchema, true ) ) { $lbConf['serverTemplate']['schema'] = $mainConfig->get( 'DBmwschema' ); diff --git a/includes/debug/logger/LegacySpi.php b/includes/debug/logger/LegacySpi.php index 8e750cab25..cb0e066cd2 100644 --- a/includes/debug/logger/LegacySpi.php +++ b/includes/debug/logger/LegacySpi.php @@ -26,7 +26,7 @@ namespace MediaWiki\Logger; * Usage: * @code * $wgMWLoggerDefaultSpi = [ - * 'class' => '\\MediaWiki\\Logger\\LegacySpi', + * 'class' => \MediaWiki\Logger\LegacySpi::class, * ]; * @endcode * diff --git a/includes/debug/logger/MonologSpi.php b/includes/debug/logger/MonologSpi.php index 197b269b0a..645eca9d35 100644 --- a/includes/debug/logger/MonologSpi.php +++ b/includes/debug/logger/MonologSpi.php @@ -40,7 +40,7 @@ use ObjectFactory; * default SPI provider: * @code * $wgMWLoggerDefaultSpi = [ - * 'class' => '\\MediaWiki\\Logger\\MonologSpi', + * 'class' => \MediaWiki\Logger\MonologSpi::class, * 'args' => [ [ * 'loggers' => [ * '@default' => [ @@ -54,29 +54,29 @@ use ObjectFactory; * ], * 'processors' => [ * 'wiki' => [ - * 'class' => '\\MediaWiki\\Logger\\Monolog\\WikiProcessor', + * 'class' => \MediaWiki\Logger\Monolog\WikiProcessor::class, * ], * 'psr' => [ - * 'class' => '\\Monolog\\Processor\\PsrLogMessageProcessor', + * 'class' => \Monolog\Processor\PsrLogMessageProcessor::class, * ], * 'pid' => [ - * 'class' => '\\Monolog\\Processor\\ProcessIdProcessor', + * 'class' => \Monolog\Processor\ProcessIdProcessor::class, * ], * 'uid' => [ - * 'class' => '\\Monolog\\Processor\\UidProcessor', + * 'class' => \Monolog\Processor\UidProcessor::class, * ], * 'web' => [ - * 'class' => '\\Monolog\\Processor\\WebProcessor', + * 'class' => \Monolog\Processor\WebProcessor::class, * ], * ], * 'handlers' => [ * 'stream' => [ - * 'class' => '\\Monolog\\Handler\\StreamHandler', + * 'class' => \Monolog\Handler\StreamHandler::class, * 'args' => [ 'path/to/your.log' ], * 'formatter' => 'line', * ], * 'redis' => [ - * 'class' => '\\Monolog\\Handler\\RedisHandler', + * 'class' => \Monolog\Handler\RedisHandler::class, * 'args' => [ function() { * $redis = new Redis(); * $redis->connect( '127.0.0.1', 6379 ); @@ -88,7 +88,7 @@ use ObjectFactory; * 'buffer' => true, * ], * 'udp2log' => [ - * 'class' => '\\MediaWiki\\Logger\\Monolog\\LegacyHandler', + * 'class' => \MediaWiki\Logger\Monolog\LegacyHandler::class, * 'args' => [ * 'udp://127.0.0.1:8420/mediawiki * ], @@ -97,10 +97,10 @@ use ObjectFactory; * ], * 'formatters' => [ * 'line' => [ - * 'class' => '\\Monolog\\Formatter\\LineFormatter', + * 'class' => \Monolog\Formatter\LineFormatter::class, * ], * 'logstash' => [ - * 'class' => '\\Monolog\\Formatter\\LogstashFormatter', + * 'class' => \Monolog\Formatter\LogstashFormatter::class, * 'args' => [ 'mediawiki', php_uname( 'n' ), null, '', 1 ], * ], * ], diff --git a/includes/debug/logger/NullSpi.php b/includes/debug/logger/NullSpi.php index 4862157d8c..d65c185133 100644 --- a/includes/debug/logger/NullSpi.php +++ b/includes/debug/logger/NullSpi.php @@ -29,7 +29,7 @@ use Psr\Log\NullLogger; * Usage: * * $wgMWLoggerDefaultSpi = [ - * 'class' => '\\MediaWiki\\Logger\\NullSpi', + * 'class' => \MediaWiki\Logger\NullSpi::class, * ]; * * @see \MediaWiki\Logger\LoggerFactory diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 6d95919a87..16f226c78f 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -55,7 +55,7 @@ class MWException extends Exception { global $wgLang; foreach ( $this->getTrace() as $frame ) { - if ( isset( $frame['class'] ) && $frame['class'] === 'LocalisationCache' ) { + if ( isset( $frame['class'] ) && $frame['class'] === LocalisationCache::class ) { return false; } } diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index d863a2bb58..205ec77773 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -300,7 +300,7 @@ TXT; $logger = LoggerFactory::getInstance( 'fatal' ); $logger->error( $msg, [ 'fatal_exception' => [ - 'class' => 'ErrorException', + 'class' => ErrorException::class, 'message' => "PHP Fatal Error: {$message}", 'code' => $level, 'file' => $file, diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index b22e87bf4a..dc8dfd0b3e 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -90,7 +90,7 @@ class MWExceptionRenderer { private static function useOutputPage( $e ) { // Can the extension use the Message class/wfMessage to get i18n-ed messages? foreach ( $e->getTrace() as $frame ) { - if ( isset( $frame['class'] ) && $frame['class'] === 'LocalisationCache' ) { + if ( isset( $frame['class'] ) && $frame['class'] === LocalisationCache::class ) { return false; } } diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index 8182d62ec6..9239c6cc34 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -91,7 +91,7 @@ class FileBackendGroup { // Get the FS backend configuration $autoBackends[] = [ 'name' => $backendName, - 'class' => 'FSFileBackend', + 'class' => FSFileBackend::class, 'lockManager' => 'fsLockManager', 'containerPaths' => [ "{$repoName}-public" => "{$directory}", @@ -155,7 +155,7 @@ class FileBackendGroup { $config = $this->config( $name ); $class = $config['class']; - if ( $class === 'FileBackendMultiWrite' ) { + if ( $class === FileBackendMultiWrite::class ) { foreach ( $config['backends'] as $index => $beConfig ) { if ( isset( $beConfig['template'] ) ) { // Config is just a modified version of a registered backend's. @@ -190,9 +190,9 @@ class FileBackendGroup { 'wikiId' => wfWikiID(), // e.g. "my_wiki-en_" 'mimeCallback' => [ $this, 'guessMimeInternal' ], 'obResetFunc' => 'wfResetOutputBuffers', - 'streamMimeFunc' => [ 'StreamFile', 'contentTypeFromPath' ], + 'streamMimeFunc' => [ StreamFile::class, 'contentTypeFromPath' ], 'tmpDirectory' => wfTempDir(), - 'statusWrapper' => [ 'Status', 'wrap' ], + 'statusWrapper' => [ Status::class, 'wrap' ], 'wanCache' => MediaWikiServices::getInstance()->getMainWANObjectCache(), 'srvCache' => ObjectCache::getLocalServerInstance( 'hash' ), 'logger' => LoggerFactory::getInstance( 'FileOperation' ), @@ -202,7 +202,7 @@ class FileBackendGroup { LockManagerGroup::singleton( $config['wikiId'] )->get( $config['lockManager'] ); $config['fileJournal'] = isset( $config['fileJournal'] ) ? FileJournal::factory( $config['fileJournal'], $name ) - : FileJournal::factory( [ 'class' => 'NullFileJournal' ], $name ); + : FileJournal::factory( [ 'class' => NullFileJournal::class ], $name ); return $config; } diff --git a/includes/filebackend/lockmanager/LockManagerGroup.php b/includes/filebackend/lockmanager/LockManagerGroup.php index e6f992c321..5d79dac0c2 100644 --- a/includes/filebackend/lockmanager/LockManagerGroup.php +++ b/includes/filebackend/lockmanager/LockManagerGroup.php @@ -116,7 +116,7 @@ class LockManagerGroup { if ( !isset( $this->managers[$name]['instance'] ) ) { $class = $this->managers[$name]['class']; $config = $this->managers[$name]['config']; - if ( $class === 'DBLockManager' ) { + if ( $class === DBLockManager::class ) { $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); $lb = $lbFactory->newMainLB( $config['domain'] ); $dbw = $lb->getLazyConnectionRef( DB_MASTER, [], $config['domain'] ); diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 5d22b8d80d..b4df68a4c9 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -124,7 +124,7 @@ class FileRepo { protected $isPrivate; /** @var array callable Override these in the base class */ - protected $fileFactory = [ 'UnregisteredLocalFile', 'newFromTitle' ]; + protected $fileFactory = [ UnregisteredLocalFile::class, 'newFromTitle' ]; /** @var array callable|bool Override these in the base class */ protected $oldFileFactory = false; /** @var array callable|bool Override these in the base class */ @@ -1722,7 +1722,7 @@ class FileRepo { * @return Status */ public function newFatal( $message /*, parameters...*/ ) { - $status = call_user_func_array( [ 'Status', 'newFatal' ], func_get_args() ); + $status = call_user_func_array( [ Status::class, 'newFatal' ], func_get_args() ); $status->cleanCallback = $this->getErrorCleanupFunction(); return $status; diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 45a5c8247f..5a37701285 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -29,7 +29,7 @@ use MediaWiki\Logger\LoggerFactory; * Example config: * * $wgForeignFileRepos[] = [ - * 'class' => 'ForeignAPIRepo', + * 'class' => ForeignAPIRepo::class, * 'name' => 'shared', * 'apibase' => 'https://en.wikipedia.org/w/api.php', * 'fetchDescription' => true, // Optional @@ -53,7 +53,7 @@ class ForeignAPIRepo extends FileRepo { 'timestamp', ]; - protected $fileFactory = [ 'ForeignAPIFile', 'newFromTitle' ]; + protected $fileFactory = [ ForeignAPIFile::class, 'newFromTitle' ]; /** @var int Check back with Commons after this expiry */ protected $apiThumbCacheExpiry = 86400; // 1 day (24*3600) diff --git a/includes/filerepo/ForeignDBRepo.php b/includes/filerepo/ForeignDBRepo.php index bce3005c67..7879448bb6 100644 --- a/includes/filerepo/ForeignDBRepo.php +++ b/includes/filerepo/ForeignDBRepo.php @@ -58,9 +58,9 @@ class ForeignDBRepo extends LocalRepo { protected $dbConn; /** @var callable */ - protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ]; + protected $fileFactory = [ ForeignDBFile::class, 'newFromTitle' ]; /** @var callable */ - protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ]; + protected $fileFromRowFactory = [ ForeignDBFile::class, 'newFromRow' ]; /** * @param array|null $info diff --git a/includes/filerepo/ForeignDBViaLBRepo.php b/includes/filerepo/ForeignDBViaLBRepo.php index bcd253fb4a..249cd27cfe 100644 --- a/includes/filerepo/ForeignDBViaLBRepo.php +++ b/includes/filerepo/ForeignDBViaLBRepo.php @@ -37,10 +37,10 @@ class ForeignDBViaLBRepo extends LocalRepo { protected $tablePrefix; /** @var array */ - protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ]; + protected $fileFactory = [ ForeignDBFile::class, 'newFromTitle' ]; /** @var array */ - protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ]; + protected $fileFromRowFactory = [ ForeignDBFile::class, 'newFromRow' ]; /** @var bool */ protected $hasSharedCache; diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index f5b83ae5cc..1bf534649f 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -34,17 +34,17 @@ use Wikimedia\Rdbms\IDatabase; */ class LocalRepo extends FileRepo { /** @var callable */ - protected $fileFactory = [ 'LocalFile', 'newFromTitle' ]; + protected $fileFactory = [ LocalFile::class, 'newFromTitle' ]; /** @var callable */ - protected $fileFactoryKey = [ 'LocalFile', 'newFromKey' ]; + protected $fileFactoryKey = [ LocalFile::class, 'newFromKey' ]; /** @var callable */ - protected $fileFromRowFactory = [ 'LocalFile', 'newFromRow' ]; + protected $fileFromRowFactory = [ LocalFile::class, 'newFromRow' ]; /** @var callable */ - protected $oldFileFromRowFactory = [ 'OldLocalFile', 'newFromRow' ]; + protected $oldFileFromRowFactory = [ OldLocalFile::class, 'newFromRow' ]; /** @var callable */ - protected $oldFileFactory = [ 'OldLocalFile', 'newFromTitle' ]; + protected $oldFileFactory = [ OldLocalFile::class, 'newFromTitle' ]; /** @var callable */ - protected $oldFileFactoryKey = [ 'OldLocalFile', 'newFromKey' ]; + protected $oldFileFactoryKey = [ OldLocalFile::class, 'newFromKey' ]; function __construct( array $info = null ) { parent::__construct( $info ); diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 4e79de2d56..cfbd062a35 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -148,7 +148,7 @@ abstract class File implements IDBAccessObject { protected $isSafeFile; /** @var string Required Repository class type */ - protected $repoClass = 'FileRepo'; + protected $repoClass = FileRepo::class; /** @var array Cache of tmp filepaths pointing to generated bucket thumbnails, keyed by width */ protected $tmpBucketedThumbCache = []; diff --git a/includes/filerepo/file/ForeignAPIFile.php b/includes/filerepo/file/ForeignAPIFile.php index 16c154f788..8dcb289abd 100644 --- a/includes/filerepo/file/ForeignAPIFile.php +++ b/includes/filerepo/file/ForeignAPIFile.php @@ -33,7 +33,7 @@ class ForeignAPIFile extends File { /** @var array */ private $mInfo = []; - protected $repoClass = 'ForeignApiRepo'; + protected $repoClass = ForeignApiRepo::class; /** * @param Title|string|bool $title diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 4248f953e1..7be8f06246 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -84,7 +84,7 @@ class LocalFile extends File { protected $deleted; /** @var string */ - protected $repoClass = 'LocalRepo'; + protected $repoClass = LocalRepo::class; /** @var int Number of line to return by nextHistoryLine() (constructor) */ private $historyLine; diff --git a/includes/gallery/ImageGalleryBase.php b/includes/gallery/ImageGalleryBase.php index 700c8ee50f..318329726a 100644 --- a/includes/gallery/ImageGalleryBase.php +++ b/includes/gallery/ImageGalleryBase.php @@ -113,12 +113,12 @@ abstract class ImageGalleryBase extends ContextSource { private static function loadModes() { if ( self::$modeMapping === false ) { self::$modeMapping = [ - 'traditional' => 'TraditionalImageGallery', - 'nolines' => 'NolinesImageGallery', - 'packed' => 'PackedImageGallery', - 'packed-hover' => 'PackedHoverImageGallery', - 'packed-overlay' => 'PackedOverlayImageGallery', - 'slideshow' => 'SlideshowImageGallery', + 'traditional' => TraditionalImageGallery::class, + 'nolines' => NolinesImageGallery::class, + 'packed' => PackedImageGallery::class, + 'packed-hover' => PackedHoverImageGallery::class, + 'packed-overlay' => PackedOverlayImageGallery::class, + 'slideshow' => SlideshowImageGallery::class, ]; // Allow extensions to make a new gallery format. Hooks::run( 'GalleryGetModes', [ &self::$modeMapping ] ); diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index 296c4b3bb9..afb815f2d4 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -128,44 +128,44 @@ class HTMLForm extends ContextSource { // A mapping of 'type' inputs onto standard HTMLFormField subclasses public static $typeMappings = [ - 'api' => 'HTMLApiField', - 'text' => 'HTMLTextField', - 'textwithbutton' => 'HTMLTextFieldWithButton', - 'textarea' => 'HTMLTextAreaField', - 'select' => 'HTMLSelectField', - 'combobox' => 'HTMLComboboxField', - 'radio' => 'HTMLRadioField', - 'multiselect' => 'HTMLMultiSelectField', - 'limitselect' => 'HTMLSelectLimitField', - 'check' => 'HTMLCheckField', - 'toggle' => 'HTMLCheckField', - 'int' => 'HTMLIntField', - 'float' => 'HTMLFloatField', - 'info' => 'HTMLInfoField', - 'selectorother' => 'HTMLSelectOrOtherField', - 'selectandother' => 'HTMLSelectAndOtherField', - 'namespaceselect' => 'HTMLSelectNamespace', - 'namespaceselectwithbutton' => 'HTMLSelectNamespaceWithButton', - 'tagfilter' => 'HTMLTagFilter', - 'sizefilter' => 'HTMLSizeFilterField', - 'submit' => 'HTMLSubmitField', - 'hidden' => 'HTMLHiddenField', - 'edittools' => 'HTMLEditTools', - 'checkmatrix' => 'HTMLCheckMatrix', - 'cloner' => 'HTMLFormFieldCloner', - 'autocompleteselect' => 'HTMLAutoCompleteSelectField', - 'date' => 'HTMLDateTimeField', - 'time' => 'HTMLDateTimeField', - 'datetime' => 'HTMLDateTimeField', + 'api' => HTMLApiField::class, + 'text' => HTMLTextField::class, + 'textwithbutton' => HTMLTextFieldWithButton::class, + 'textarea' => HTMLTextAreaField::class, + 'select' => HTMLSelectField::class, + 'combobox' => HTMLComboboxField::class, + 'radio' => HTMLRadioField::class, + 'multiselect' => HTMLMultiSelectField::class, + 'limitselect' => HTMLSelectLimitField::class, + 'check' => HTMLCheckField::class, + 'toggle' => HTMLCheckField::class, + 'int' => HTMLIntField::class, + 'float' => HTMLFloatField::class, + 'info' => HTMLInfoField::class, + 'selectorother' => HTMLSelectOrOtherField::class, + 'selectandother' => HTMLSelectAndOtherField::class, + 'namespaceselect' => HTMLSelectNamespace::class, + 'namespaceselectwithbutton' => HTMLSelectNamespaceWithButton::class, + 'tagfilter' => HTMLTagFilter::class, + 'sizefilter' => HTMLSizeFilterField::class, + 'submit' => HTMLSubmitField::class, + 'hidden' => HTMLHiddenField::class, + 'edittools' => HTMLEditTools::class, + 'checkmatrix' => HTMLCheckMatrix::class, + 'cloner' => HTMLFormFieldCloner::class, + 'autocompleteselect' => HTMLAutoCompleteSelectField::class, + 'date' => HTMLDateTimeField::class, + 'time' => HTMLDateTimeField::class, + 'datetime' => HTMLDateTimeField::class, // HTMLTextField will output the correct type="" attribute automagically. // There are about four zillion other HTML5 input types, like range, but // we don't use those at the moment, so no point in adding all of them. - 'email' => 'HTMLTextField', - 'password' => 'HTMLTextField', - 'url' => 'HTMLTextField', - 'title' => 'HTMLTitleTextField', - 'user' => 'HTMLUserTextField', - 'usersmultiselect' => 'HTMLUsersMultiselectField', + 'email' => HTMLTextField::class, + 'password' => HTMLTextField::class, + 'url' => HTMLTextField::class, + 'title' => HTMLTitleTextField::class, + 'user' => HTMLUserTextField::class, + 'usersmultiselect' => HTMLUsersMultiselectField::class, ]; public $mFieldData; diff --git a/includes/htmlform/fields/HTMLMultiSelectField.php b/includes/htmlform/fields/HTMLMultiSelectField.php index 09bacadb69..e8a7e992ca 100644 --- a/includes/htmlform/fields/HTMLMultiSelectField.php +++ b/includes/htmlform/fields/HTMLMultiSelectField.php @@ -102,7 +102,7 @@ class HTMLMultiSelectField extends HTMLFormField implements HTMLNestedFilterable if ( $this->mParent instanceof OOUIHTMLForm ) { throw new MWException( 'HTMLMultiSelectField#getOneCheckbox() is not supported' ); } else { - $elementFunc = [ 'Html', $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element' ]; + $elementFunc = [ Html::class, $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element' ]; $checkbox = Xml::check( "{$this->mName}[]", $checked, $attribs ) . ' ' . diff --git a/includes/htmlform/fields/HTMLRadioField.php b/includes/htmlform/fields/HTMLRadioField.php index c98e1ec07b..f3bcc0e1eb 100644 --- a/includes/htmlform/fields/HTMLRadioField.php +++ b/includes/htmlform/fields/HTMLRadioField.php @@ -78,7 +78,7 @@ class HTMLRadioField extends HTMLFormField { $html = ''; $attribs = $this->getAttributes( [ 'disabled', 'tabindex' ] ); - $elementFunc = [ 'Html', $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element' ]; + $elementFunc = [ Html::class, $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element' ]; # @todo Should this produce an unordered list perhaps? foreach ( $options as $label => $info ) { diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index 5978550c54..8991f5ef4d 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -65,7 +65,7 @@ class WikiImporter { $this->config = $config; if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) { - stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' ); + stream_wrapper_register( 'uploadsource', UploadSourceAdapter::class ); } $id = UploadSourceAdapter::registerSource( $source ); diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 176d0af7f5..2083500ed0 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -1072,7 +1072,7 @@ abstract class DatabaseUpdater { "maintenance/populateLogUsertext.php.\n" ); - $task = $this->maintenance->runChild( 'PopulateLogUsertext' ); + $task = $this->maintenance->runChild( PopulateLogUsertext::class ); $task->execute(); $this->output( "done.\n" ); } @@ -1088,7 +1088,7 @@ abstract class DatabaseUpdater { "databases, you may want to hit Ctrl-C and do this manually with\n" . "maintenance/populateLogSearch.php.\n" ); - $task = $this->maintenance->runChild( 'PopulateLogSearch' ); + $task = $this->maintenance->runChild( PopulateLogSearch::class ); $task->execute(); $this->output( "done.\n" ); } @@ -1128,7 +1128,7 @@ abstract class DatabaseUpdater { } $this->output( "Updating category collations..." ); - $task = $this->maintenance->runChild( 'UpdateCollation' ); + $task = $this->maintenance->runChild( UpdateCollation::class ); $task->execute(); $this->output( "...done.\n" ); } @@ -1139,7 +1139,7 @@ abstract class DatabaseUpdater { */ protected function doMigrateUserOptions() { if ( $this->db->tableExists( 'user_properties' ) ) { - $cl = $this->maintenance->runChild( 'ConvertUserOptions', 'convertUserOptions.php' ); + $cl = $this->maintenance->runChild( ConvertUserOptions::class, 'convertUserOptions.php' ); $cl->execute(); $this->output( "done.\n" ); } @@ -1177,7 +1177,9 @@ abstract class DatabaseUpdater { /** * @var $cl RebuildLocalisationCache */ - $cl = $this->maintenance->runChild( 'RebuildLocalisationCache', 'rebuildLocalisationCache.php' ); + $cl = $this->maintenance->runChild( + RebuildLocalisationCache::class, 'rebuildLocalisationCache.php' + ); $this->output( "Rebuilding localisation cache...\n" ); $cl->setForce(); $cl->execute(); @@ -1224,7 +1226,7 @@ abstract class DatabaseUpdater { "databases, you may want to hit Ctrl-C and do this manually with\n" . "maintenance/migrateComments.php.\n" ); - $task = $this->maintenance->runChild( 'MigrateComments', 'migrateComments.php' ); + $task = $this->maintenance->runChild( MigrateComments::class, 'migrateComments.php' ); $task->execute(); $this->output( "done.\n" ); } @@ -1236,7 +1238,7 @@ abstract class DatabaseUpdater { */ protected function migrateArchiveText() { $this->output( "Migrating archive ar_text to modern storage.\n" ); - $task = $this->maintenance->runChild( 'MigrateArchiveText', 'migrateArchiveText.php' ); + $task = $this->maintenance->runChild( MigrateArchiveText::class, 'migrateArchiveText.php' ); $task->execute(); $this->output( "done.\n" ); } diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 5ea9bfea32..5e018e0559 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -364,7 +364,7 @@ abstract class Installer { // disable (problematic) object cache types explicitly, preserving all other (working) ones // bug T113843 - $emptyCache = [ 'class' => 'EmptyBagOStuff' ]; + $emptyCache = [ 'class' => EmptyBagOStuff::class ]; $objectCaches = [ CACHE_NONE => $emptyCache, @@ -1677,7 +1677,7 @@ abstract class Installer { // implementation that won't stomp on PHP's cookies. $GLOBALS['wgSessionProviders'] = [ [ - 'class' => 'InstallerSessionProvider', + 'class' => InstallerSessionProvider::class, 'args' => [ [ 'priority' => 1, ] ] diff --git a/includes/installer/InstallerOverrides.php b/includes/installer/InstallerOverrides.php index eba3a20d6c..c9154b9a86 100644 --- a/includes/installer/InstallerOverrides.php +++ b/includes/installer/InstallerOverrides.php @@ -30,9 +30,9 @@ class InstallerOverrides { if ( !$overrides ) { $overrides = [ - 'LocalSettingsGenerator' => 'LocalSettingsGenerator', - 'WebInstaller' => 'WebInstaller', - 'CliInstaller' => 'CliInstaller', + 'LocalSettingsGenerator' => LocalSettingsGenerator::class, + 'WebInstaller' => WebInstaller::class, + 'CliInstaller' => CliInstaller::class, ]; foreach ( glob( "$IP/mw-config/overrides/*.php" ) as $file ) { require $file; diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 44086a125e..bce540557d 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -432,7 +432,7 @@ class MysqlUpdater extends DatabaseUpdater { } protected function doOldLinksUpdate() { - $cl = $this->maintenance->runChild( 'ConvertLinks' ); + $cl = $this->maintenance->runChild( ConvertLinks::class ); $cl->execute(); } @@ -942,7 +942,7 @@ class MysqlUpdater extends DatabaseUpdater { $this->output( "done.\n" ); $this->output( "Migrating old restrictions to new table...\n" ); - $task = $this->maintenance->runChild( 'UpdateRestrictions' ); + $task = $this->maintenance->runChild( UpdateRestrictions::class ); $task->execute(); } @@ -965,7 +965,7 @@ class MysqlUpdater extends DatabaseUpdater { "may want to hit Ctrl-C and do this manually with maintenance/\n" . "populateCategory.php.\n" ); - $task = $this->maintenance->runChild( 'PopulateCategory' ); + $task = $this->maintenance->runChild( PopulateCategory::class ); $task->execute(); $this->output( "Done populating category table.\n" ); } @@ -977,7 +977,7 @@ class MysqlUpdater extends DatabaseUpdater { "databases, you may want to hit Ctrl-C and do this manually with\n" . "maintenance/populateParentId.php.\n" ); - $task = $this->maintenance->runChild( 'PopulateParentId' ); + $task = $this->maintenance->runChild( PopulateParentId::class ); $task->execute(); } } diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index d5909f4e1f..31718fefa0 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -321,7 +321,7 @@ EOT; return "# SQLite-specific settings \$wgSQLiteDataDir = \"{$dir}\"; \$wgObjectCaches[CACHE_DB] = [ - 'class' => 'SqlBagOStuff', + 'class' => SqlBagOStuff::class, 'loggroup' => 'SQLBagOStuff', 'server' => [ 'type' => 'sqlite', diff --git a/includes/libs/filebackend/FileBackend.php b/includes/libs/filebackend/FileBackend.php index 51308c1371..08f960a646 100644 --- a/includes/libs/filebackend/FileBackend.php +++ b/includes/libs/filebackend/FileBackend.php @@ -175,7 +175,7 @@ abstract class FileBackend implements LoggerAwareInterface { : new NullLockManager( [] ); $this->fileJournal = isset( $config['fileJournal'] ) ? $config['fileJournal'] - : FileJournal::factory( [ 'class' => 'NullFileJournal' ], $this->name ); + : FileJournal::factory( [ 'class' => NullFileJournal::class ], $this->name ); $this->readOnly = isset( $config['readOnly'] ) ? (string)$config['readOnly'] : ''; @@ -1597,7 +1597,7 @@ abstract class FileBackend implements LoggerAwareInterface { final protected function newStatus() { $args = func_get_args(); if ( count( $args ) ) { - $sv = call_user_func_array( [ 'StatusValue', 'newFatal' ], $args ); + $sv = call_user_func_array( [ StatusValue::class, 'newFatal' ], $args ); } else { $sv = StatusValue::newGood(); } diff --git a/includes/libs/filebackend/FileBackendStore.php b/includes/libs/filebackend/FileBackendStore.php index b8eec3f01d..da8b4ce9da 100644 --- a/includes/libs/filebackend/FileBackendStore.php +++ b/includes/libs/filebackend/FileBackendStore.php @@ -1008,13 +1008,13 @@ abstract class FileBackendStore extends FileBackend { */ final public function getOperationsInternal( array $ops ) { $supportedOps = [ - 'store' => 'StoreFileOp', - 'copy' => 'CopyFileOp', - 'move' => 'MoveFileOp', - 'delete' => 'DeleteFileOp', - 'create' => 'CreateFileOp', - 'describe' => 'DescribeFileOp', - 'null' => 'NullFileOp' + 'store' => StoreFileOp::class, + 'copy' => CopyFileOp::class, + 'move' => MoveFileOp::class, + 'delete' => DeleteFileOp::class, + 'create' => CreateFileOp::class, + 'describe' => DescribeFileOp::class, + 'null' => NullFileOp::class ]; $performOps = []; // array of FileOp objects diff --git a/includes/libs/lockmanager/MemcLockManager.php b/includes/libs/lockmanager/MemcLockManager.php index aecdf60cda..6274d60518 100644 --- a/includes/libs/lockmanager/MemcLockManager.php +++ b/includes/libs/lockmanager/MemcLockManager.php @@ -69,10 +69,10 @@ class MemcLockManager extends QuorumLockManager { $this->srvsByBucket = array_values( $this->srvsByBucket ); // consecutive $memcConfig = isset( $config['memcConfig'] ) ? $config['memcConfig'] : []; - $memcConfig += [ 'class' => 'MemcachedPhpBagOStuff' ]; // default + $memcConfig += [ 'class' => MemcachedPhpBagOStuff::class ]; // default $class = $memcConfig['class']; - if ( !is_subclass_of( $class, 'MemcachedBagOStuff' ) ) { + if ( !is_subclass_of( $class, MemcachedBagOStuff::class ) ) { throw new InvalidArgumentException( "$class is not of type MemcachedBagOStuff." ); } diff --git a/includes/libs/rdbms/database/resultwrapper/MssqlResultWrapper.php b/includes/libs/rdbms/database/resultwrapper/MssqlResultWrapper.php index 298ec61934..4b79044655 100644 --- a/includes/libs/rdbms/database/resultwrapper/MssqlResultWrapper.php +++ b/includes/libs/rdbms/database/resultwrapper/MssqlResultWrapper.php @@ -15,7 +15,7 @@ class MssqlResultWrapper extends ResultWrapper { $res = $this->result; if ( $this->mSeekTo !== null ) { - $result = sqlsrv_fetch_object( $res, 'stdClass', [], + $result = sqlsrv_fetch_object( $res, stdClass::class, [], SQLSRV_SCROLL_ABSOLUTE, $this->mSeekTo ); $this->mSeekTo = null; } else { diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancerSingle.php b/includes/libs/rdbms/loadbalancer/LoadBalancerSingle.php index c73756330a..b5e1a808bc 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancerSingle.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancerSingle.php @@ -77,4 +77,4 @@ class LoadBalancerSingle extends LoadBalancer { } } -class_alias( 'Wikimedia\Rdbms\LoadBalancerSingle', 'LoadBalancerSingle' ); +class_alias( LoadBalancerSingle::class, 'LoadBalancerSingle' ); diff --git a/includes/page/CategoryPage.php b/includes/page/CategoryPage.php index 2d7e8f24fd..491726bedd 100644 --- a/includes/page/CategoryPage.php +++ b/includes/page/CategoryPage.php @@ -27,7 +27,7 @@ */ class CategoryPage extends Article { # Subclasses can change this to override the viewer class. - protected $mCategoryViewerClass = 'CategoryViewer'; + protected $mCategoryViewerClass = CategoryViewer::class; /** * @var WikiCategoryPage diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 831c1fff46..b2d8511de8 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -270,15 +270,15 @@ class Parser { $this->mPreprocessorClass = $conf['preprocessorClass']; } elseif ( defined( 'HPHP_VERSION' ) ) { # Preprocessor_Hash is much faster than Preprocessor_DOM under HipHop - $this->mPreprocessorClass = 'Preprocessor_Hash'; + $this->mPreprocessorClass = Preprocessor_Hash::class; } elseif ( extension_loaded( 'domxml' ) ) { # PECL extension that conflicts with the core DOM extension (T15770) wfDebug( "Warning: you have the obsolete domxml extension for PHP. Please remove it!\n" ); - $this->mPreprocessorClass = 'Preprocessor_Hash'; + $this->mPreprocessorClass = Preprocessor_Hash::class; } elseif ( extension_loaded( 'dom' ) ) { - $this->mPreprocessorClass = 'Preprocessor_DOM'; + $this->mPreprocessorClass = Preprocessor_DOM::class; } else { - $this->mPreprocessorClass = 'Preprocessor_Hash'; + $this->mPreprocessorClass = Preprocessor_Hash::class; } wfDebug( __CLASS__ . ": using preprocessor: {$this->mPreprocessorClass}\n" ); } diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index f99089b895..2f284afbec 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -1059,8 +1059,8 @@ class ParserOptions { 'printable' => false, 'allowUnsafeRawHtml' => true, 'wrapclass' => 'mw-parser-output', - 'currentRevisionCallback' => [ 'Parser', 'statelessFetchRevision' ], - 'templateCallback' => [ 'Parser', 'statelessFetchTemplate' ], + 'currentRevisionCallback' => [ Parser::class, 'statelessFetchRevision' ], + 'templateCallback' => [ Parser::class, 'statelessFetchTemplate' ], 'speculativeRevIdCallback' => null, ]; diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 79021dda23..4db2855570 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -823,7 +823,7 @@ class PPDStack { */ public $top; public $out; - public $elementClass = 'PPDStackElement'; + public $elementClass = PPDStackElement::class; public static $false = false; @@ -931,7 +931,7 @@ class PPDStackElement { */ public $lineStart; - public $partClass = 'PPDPart'; + public $partClass = PPDPart::class; public function __construct( $data = [] ) { $class = $this->partClass; diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 468b009aa9..c4c0c5ada4 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -792,7 +792,7 @@ class Preprocessor_Hash extends Preprocessor { class PPDStack_Hash extends PPDStack { public function __construct() { - $this->elementClass = 'PPDStackElement_Hash'; + $this->elementClass = PPDStackElement_Hash::class; parent::__construct(); $this->rootAccum = []; } @@ -805,7 +805,7 @@ class PPDStack_Hash extends PPDStack { class PPDStackElement_Hash extends PPDStackElement { public function __construct( $data = [] ) { - $this->partClass = 'PPDPart_Hash'; + $this->partClass = PPDPart_Hash::class; parent::__construct( $data ); } @@ -1766,12 +1766,12 @@ class PPNode_Hash_Tree implements PPNode { $descriptor = $store[$index]; if ( is_string( $descriptor ) ) { - $class = 'PPNode_Hash_Text'; + $class = PPNode_Hash_Text::class; } elseif ( is_array( $descriptor ) ) { if ( $descriptor[self::NAME][0] === '@' ) { - $class = 'PPNode_Hash_Attr'; + $class = PPNode_Hash_Attr::class; } else { - $class = 'PPNode_Hash_Tree'; + $class = self::class; } } else { throw new MWException( __METHOD__.': invalid node descriptor' ); diff --git a/includes/parser/Sanitizer.php b/includes/parser/Sanitizer.php index b570a43c06..8fee2c77c1 100644 --- a/includes/parser/Sanitizer.php +++ b/includes/parser/Sanitizer.php @@ -1171,7 +1171,7 @@ class Sanitizer { # Stupid hack $encValue = preg_replace_callback( '/((?i)' . wfUrlProtocols() . ')/', - [ 'Sanitizer', 'armorLinksCallback' ], + [ self::class, 'armorLinksCallback' ], $encValue ); return $encValue; } @@ -1549,7 +1549,7 @@ class Sanitizer { static function normalizeCharReferences( $text ) { return preg_replace_callback( self::CHAR_REFS_REGEX, - [ 'Sanitizer', 'normalizeCharReferencesCallback' ], + [ self::class, 'normalizeCharReferencesCallback' ], $text ); } @@ -1649,7 +1649,7 @@ class Sanitizer { public static function decodeCharReferences( $text ) { return preg_replace_callback( self::CHAR_REFS_REGEX, - [ 'Sanitizer', 'decodeCharReferencesCallback' ], + [ self::class, 'decodeCharReferencesCallback' ], $text ); } @@ -1667,7 +1667,7 @@ class Sanitizer { global $wgContLang; $text = preg_replace_callback( self::CHAR_REFS_REGEX, - [ 'Sanitizer', 'decodeCharReferencesCallback' ], + [ self::class, 'decodeCharReferencesCallback' ], $text, -1, //limit $count diff --git a/includes/password/PasswordFactory.php b/includes/password/PasswordFactory.php index 3383fe385e..bc37b48404 100644 --- a/includes/password/PasswordFactory.php +++ b/includes/password/PasswordFactory.php @@ -41,7 +41,7 @@ final class PasswordFactory { * @see Setup.php */ private $types = [ - '' => [ 'type' => '', 'class' => 'InvalidPassword' ], + '' => [ 'type' => '', 'class' => InvalidPassword::class ], ]; /** diff --git a/includes/preferences/DefaultPreferencesFactory.php b/includes/preferences/DefaultPreferencesFactory.php index a23d6446a1..c1e9a59cec 100644 --- a/includes/preferences/DefaultPreferencesFactory.php +++ b/includes/preferences/DefaultPreferencesFactory.php @@ -205,7 +205,7 @@ class DefaultPreferencesFactory implements PreferencesFactory { // Handling for multiselect preferences if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) || - ( isset( $info['class'] ) && $info['class'] == 'HTMLMultiSelectField' ) ) { + ( isset( $info['class'] ) && $info['class'] == \HTMLMultiSelectField::class ) ) { $options = HTMLFormField::flattenOptions( $info['options'] ); $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name; $val = []; @@ -219,7 +219,7 @@ class DefaultPreferencesFactory implements PreferencesFactory { // Handling for checkmatrix preferences if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) || - ( isset( $info['class'] ) && $info['class'] == 'HTMLCheckMatrix' ) ) { + ( isset( $info['class'] ) && $info['class'] == \HTMLCheckMatrix::class ) ) { $columns = HTMLFormField::flattenOptions( $info['columns'] ); $rows = HTMLFormField::flattenOptions( $info['rows'] ); $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name; @@ -799,7 +799,7 @@ class DefaultPreferencesFactory implements PreferencesFactory { } $defaultPreferences['timecorrection'] = [ - 'class' => 'HTMLSelectOrOtherField', + 'class' => \HTMLSelectOrOtherField::class, 'label-message' => 'timezonelegend', 'options' => $tzOptions, 'default' => $tzSetting, @@ -1401,7 +1401,7 @@ class DefaultPreferencesFactory implements PreferencesFactory { public function getForm( User $user, IContextSource $context, - $formClass = 'PreferencesForm', + $formClass = PreferencesForm::class, array $remove = [] ) { $formDescriptor = $this->getFormDescriptor( $user, $context ); diff --git a/includes/preferences/PreferencesFactory.php b/includes/preferences/PreferencesFactory.php index 35237be478..685f78caaf 100644 --- a/includes/preferences/PreferencesFactory.php +++ b/includes/preferences/PreferencesFactory.php @@ -62,7 +62,7 @@ interface PreferencesFactory { public function getForm( User $user, IContextSource $contextSource, - $formClass = 'PreferencesForm', + $formClass = \PreferencesForm::class, array $remove = [] ); diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php index 81449be1f6..9021652958 100644 --- a/includes/profiler/Profiler.php +++ b/includes/profiler/Profiler.php @@ -64,7 +64,7 @@ abstract class Profiler { global $wgProfiler, $wgProfileLimit; $params = [ - 'class' => 'ProfilerStub', + 'class' => ProfilerStub::class, 'sampling' => 1, 'threshold' => $wgProfileLimit, 'output' => [], @@ -76,7 +76,7 @@ abstract class Profiler { $inSample = mt_rand( 0, $params['sampling'] - 1 ) === 0; // wfIsCLI() is not available yet if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' || !$inSample ) { - $params['class'] = 'ProfilerStub'; + $params['class'] = ProfilerStub::class; } if ( !is_array( $params['output'] ) ) { diff --git a/includes/profiler/ProfilerSectionOnly.php b/includes/profiler/ProfilerSectionOnly.php index 41260a8388..a7bc1375e9 100644 --- a/includes/profiler/ProfilerSectionOnly.php +++ b/includes/profiler/ProfilerSectionOnly.php @@ -22,7 +22,7 @@ * Profiler that only tracks explicit profiling sections * * @code - * $wgProfiler['class'] = 'ProfilerSectionOnly'; + * $wgProfiler['class'] = ProfilerSectionOnly::class; * $wgProfiler['output'] = 'text'; * $wgProfiler['visible'] = true; * @endcode diff --git a/includes/profiler/ProfilerXhprof.php b/includes/profiler/ProfilerXhprof.php index 09191ee51d..ffa441ed87 100644 --- a/includes/profiler/ProfilerXhprof.php +++ b/includes/profiler/ProfilerXhprof.php @@ -22,14 +22,14 @@ * Profiler wrapper for XHProf extension. * * @code - * $wgProfiler['class'] = 'ProfilerXhprof'; + * $wgProfiler['class'] = ProfilerXhprof::class; * $wgProfiler['flags'] = XHPROF_FLAGS_NO_BUILTINS; * $wgProfiler['output'] = 'text'; * $wgProfiler['visible'] = true; * @endcode * * @code - * $wgProfiler['class'] = 'ProfilerXhprof'; + * $wgProfiler['class'] = ProfilerXhprof::class; * $wgProfiler['flags'] = XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY | XHPROF_FLAGS_NO_BUILTINS; * $wgProfiler['output'] = 'udp'; * @endcode diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 36bf6567b9..4a3e8af043 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -553,7 +553,7 @@ class ResourceLoader implements LoggerAwareInterface { $object->setLogger( $this->logger ); } else { if ( !isset( $info['class'] ) ) { - $class = 'ResourceLoaderFileModule'; + $class = ResourceLoaderFileModule::class; } else { $class = $info['class']; } @@ -586,8 +586,8 @@ class ResourceLoader implements LoggerAwareInterface { } if ( isset( $info['class'] ) && - $info['class'] !== 'ResourceLoaderFileModule' && - !is_subclass_of( $info['class'], 'ResourceLoaderFileModule' ) + $info['class'] !== ResourceLoaderFileModule::class && + !is_subclass_of( $info['class'], ResourceLoaderFileModule::class ) ) { return false; } diff --git a/includes/revisiondelete/RevisionDeleter.php b/includes/revisiondelete/RevisionDeleter.php index 76fa590d03..7b2147a5e5 100644 --- a/includes/revisiondelete/RevisionDeleter.php +++ b/includes/revisiondelete/RevisionDeleter.php @@ -29,11 +29,11 @@ class RevisionDeleter { /** List of known revdel types, with their corresponding list classes */ private static $allowedTypes = [ - 'revision' => 'RevDelRevisionList', - 'archive' => 'RevDelArchiveList', - 'oldimage' => 'RevDelFileList', - 'filearchive' => 'RevDelArchivedFileList', - 'logging' => 'RevDelLogList', + 'revision' => RevDelRevisionList::class, + 'archive' => RevDelArchiveList::class, + 'oldimage' => RevDelFileList::class, + 'filearchive' => RevDelArchivedFileList::class, + 'logging' => RevDelLogList::class, ]; /** Type map to support old log entries */ diff --git a/includes/search/SearchEngineFactory.php b/includes/search/SearchEngineFactory.php index 613d33ca09..8cdca571ae 100644 --- a/includes/search/SearchEngineFactory.php +++ b/includes/search/SearchEngineFactory.php @@ -49,17 +49,17 @@ class SearchEngineFactory { public static function getSearchEngineClass( IDatabase $db ) { switch ( $db->getType() ) { case 'sqlite': - return 'SearchSqlite'; + return SearchSqlite::class; case 'mysql': - return 'SearchMySQL'; + return SearchMySQL::class; case 'postgres': - return 'SearchPostgres'; + return SearchPostgres::class; case 'mssql': - return 'SearchMssql'; + return SearchMssql::class; case 'oracle': - return 'SearchOracle'; + return SearchOracle::class; default: - return 'SearchEngineDummy'; + return SearchEngineDummy::class; } } } diff --git a/includes/site/SiteList.php b/includes/site/SiteList.php index a94aa0b93b..b942d6e4fe 100644 --- a/includes/site/SiteList.php +++ b/includes/site/SiteList.php @@ -63,7 +63,7 @@ class SiteList extends GenericArrayObject { * @return string */ public function getObjectType() { - return 'Site'; + return Site::class; } /** diff --git a/includes/skins/SkinApi.php b/includes/skins/SkinApi.php index a14afe0715..6966ff71be 100644 --- a/includes/skins/SkinApi.php +++ b/includes/skins/SkinApi.php @@ -30,7 +30,7 @@ */ class SkinApi extends SkinTemplate { public $skinname = 'apioutput'; - public $template = 'SkinApiTemplate'; + public $template = SkinApiTemplate::class; public function setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); diff --git a/includes/skins/SkinFallback.php b/includes/skins/SkinFallback.php index 96ff228520..d5f764c6e4 100644 --- a/includes/skins/SkinFallback.php +++ b/includes/skins/SkinFallback.php @@ -14,7 +14,7 @@ class SkinFallback extends SkinTemplate { public $skinname = 'fallback'; - public $template = 'SkinFallbackTemplate'; + public $template = SkinFallbackTemplate::class; /** * Add CSS via ResourceLoader diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index 8b698e8f76..45875334bc 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -46,7 +46,7 @@ class SkinTemplate extends Skin { * @var string For QuickTemplate, the name of the subclass which will * actually fill the template. Child classes should override the default. */ - public $template = 'QuickTemplate'; + public $template = QuickTemplate::class; public $thispage; public $titletxt; diff --git a/includes/specialpage/AuthManagerSpecialPage.php b/includes/specialpage/AuthManagerSpecialPage.php index 95729f3c56..b9745de1c6 100644 --- a/includes/specialpage/AuthManagerSpecialPage.php +++ b/includes/specialpage/AuthManagerSpecialPage.php @@ -609,7 +609,7 @@ abstract class AuthManagerSpecialPage extends SpecialPage { } elseif ( array_key_exists( 'type', $definition ) ) { $class = HTMLForm::$typeMappings[$definition['type']]; } - if ( $class !== 'HTMLInfoField' ) { + if ( $class !== HTMLInfoField::class ) { $definition['tabindex'] = $i; $i++; } diff --git a/includes/specialpage/QueryPage.php b/includes/specialpage/QueryPage.php index 33b9ccb12d..b20f22214b 100644 --- a/includes/specialpage/QueryPage.php +++ b/includes/specialpage/QueryPage.php @@ -69,40 +69,40 @@ abstract class QueryPage extends SpecialPage { if ( $qp === null ) { // QueryPage subclass, Special page name $qp = [ - [ 'AncientPagesPage', 'Ancientpages' ], - [ 'BrokenRedirectsPage', 'BrokenRedirects' ], - [ 'DeadendPagesPage', 'Deadendpages' ], - [ 'DoubleRedirectsPage', 'DoubleRedirects' ], - [ 'FileDuplicateSearchPage', 'FileDuplicateSearch' ], - [ 'ListDuplicatedFilesPage', 'ListDuplicatedFiles' ], - [ 'LinkSearchPage', 'LinkSearch' ], - [ 'ListredirectsPage', 'Listredirects' ], - [ 'LonelyPagesPage', 'Lonelypages' ], - [ 'LongPagesPage', 'Longpages' ], - [ 'MediaStatisticsPage', 'MediaStatistics' ], - [ 'MIMEsearchPage', 'MIMEsearch' ], - [ 'MostcategoriesPage', 'Mostcategories' ], - [ 'MostimagesPage', 'Mostimages' ], - [ 'MostinterwikisPage', 'Mostinterwikis' ], - [ 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ], - [ 'MostlinkedTemplatesPage', 'Mostlinkedtemplates' ], - [ 'MostlinkedPage', 'Mostlinked' ], - [ 'MostrevisionsPage', 'Mostrevisions' ], - [ 'FewestrevisionsPage', 'Fewestrevisions' ], - [ 'ShortPagesPage', 'Shortpages' ], - [ 'UncategorizedCategoriesPage', 'Uncategorizedcategories' ], - [ 'UncategorizedPagesPage', 'Uncategorizedpages' ], - [ 'UncategorizedImagesPage', 'Uncategorizedimages' ], - [ 'UncategorizedTemplatesPage', 'Uncategorizedtemplates' ], - [ 'UnusedCategoriesPage', 'Unusedcategories' ], - [ 'UnusedimagesPage', 'Unusedimages' ], - [ 'WantedCategoriesPage', 'Wantedcategories' ], - [ 'WantedFilesPage', 'Wantedfiles' ], - [ 'WantedPagesPage', 'Wantedpages' ], - [ 'WantedTemplatesPage', 'Wantedtemplates' ], - [ 'UnwatchedpagesPage', 'Unwatchedpages' ], - [ 'UnusedtemplatesPage', 'Unusedtemplates' ], - [ 'WithoutInterwikiPage', 'Withoutinterwiki' ], + [ AncientPagesPage::class, 'Ancientpages' ], + [ BrokenRedirectsPage::class, 'BrokenRedirects' ], + [ DeadendPagesPage::class, 'Deadendpages' ], + [ DoubleRedirectsPage::class, 'DoubleRedirects' ], + [ FileDuplicateSearchPage::class, 'FileDuplicateSearch' ], + [ ListDuplicatedFilesPage::class, 'ListDuplicatedFiles' ], + [ LinkSearchPage::class, 'LinkSearch' ], + [ ListredirectsPage::class, 'Listredirects' ], + [ LonelyPagesPage::class, 'Lonelypages' ], + [ LongPagesPage::class, 'Longpages' ], + [ MediaStatisticsPage::class, 'MediaStatistics' ], + [ MIMEsearchPage::class, 'MIMEsearch' ], + [ MostcategoriesPage::class, 'Mostcategories' ], + [ MostimagesPage::class, 'Mostimages' ], + [ MostinterwikisPage::class, 'Mostinterwikis' ], + [ MostlinkedCategoriesPage::class, 'Mostlinkedcategories' ], + [ MostlinkedTemplatesPage::class, 'Mostlinkedtemplates' ], + [ MostlinkedPage::class, 'Mostlinked' ], + [ MostrevisionsPage::class, 'Mostrevisions' ], + [ FewestrevisionsPage::class, 'Fewestrevisions' ], + [ ShortPagesPage::class, 'Shortpages' ], + [ UncategorizedCategoriesPage::class, 'Uncategorizedcategories' ], + [ UncategorizedPagesPage::class, 'Uncategorizedpages' ], + [ UncategorizedImagesPage::class, 'Uncategorizedimages' ], + [ UncategorizedTemplatesPage::class, 'Uncategorizedtemplates' ], + [ UnusedCategoriesPage::class, 'Unusedcategories' ], + [ UnusedimagesPage::class, 'Unusedimages' ], + [ WantedCategoriesPage::class, 'Wantedcategories' ], + [ WantedFilesPage::class, 'Wantedfiles' ], + [ WantedPagesPage::class, 'Wantedpages' ], + [ WantedTemplatesPage::class, 'Wantedtemplates' ], + [ UnwatchedpagesPage::class, 'Unwatchedpages' ], + [ UnusedtemplatesPage::class, 'Unusedtemplates' ], + [ WithoutInterwikiPage::class, 'Withoutinterwiki' ], ]; Hooks::run( 'wgQueryPages', [ &$qp ] ); } diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php index 4433ddb7d6..af688e225e 100644 --- a/includes/specialpage/SpecialPageFactory.php +++ b/includes/specialpage/SpecialPageFactory.php @@ -50,143 +50,143 @@ class SpecialPageFactory { */ private static $coreList = [ // Maintenance Reports - 'BrokenRedirects' => 'BrokenRedirectsPage', - 'Deadendpages' => 'DeadendPagesPage', - 'DoubleRedirects' => 'DoubleRedirectsPage', - 'Longpages' => 'LongPagesPage', - 'Ancientpages' => 'AncientPagesPage', - 'Lonelypages' => 'LonelyPagesPage', - 'Fewestrevisions' => 'FewestrevisionsPage', - 'Withoutinterwiki' => 'WithoutInterwikiPage', - 'Protectedpages' => 'SpecialProtectedpages', - 'Protectedtitles' => 'SpecialProtectedtitles', - 'Shortpages' => 'ShortPagesPage', - 'Uncategorizedcategories' => 'UncategorizedCategoriesPage', - 'Uncategorizedimages' => 'UncategorizedImagesPage', - 'Uncategorizedpages' => 'UncategorizedPagesPage', - 'Uncategorizedtemplates' => 'UncategorizedTemplatesPage', - 'Unusedcategories' => 'UnusedCategoriesPage', - 'Unusedimages' => 'UnusedimagesPage', - 'Unusedtemplates' => 'UnusedtemplatesPage', - 'Unwatchedpages' => 'UnwatchedpagesPage', - 'Wantedcategories' => 'WantedCategoriesPage', - 'Wantedfiles' => 'WantedFilesPage', - 'Wantedpages' => 'WantedPagesPage', - 'Wantedtemplates' => 'WantedTemplatesPage', + 'BrokenRedirects' => BrokenRedirectsPage::class, + 'Deadendpages' => DeadendPagesPage::class, + 'DoubleRedirects' => DoubleRedirectsPage::class, + 'Longpages' => LongPagesPage::class, + 'Ancientpages' => AncientPagesPage::class, + 'Lonelypages' => LonelyPagesPage::class, + 'Fewestrevisions' => FewestrevisionsPage::class, + 'Withoutinterwiki' => WithoutInterwikiPage::class, + 'Protectedpages' => SpecialProtectedpages::class, + 'Protectedtitles' => SpecialProtectedtitles::class, + 'Shortpages' => ShortPagesPage::class, + 'Uncategorizedcategories' => UncategorizedCategoriesPage::class, + 'Uncategorizedimages' => UncategorizedImagesPage::class, + 'Uncategorizedpages' => UncategorizedPagesPage::class, + 'Uncategorizedtemplates' => UncategorizedTemplatesPage::class, + 'Unusedcategories' => UnusedCategoriesPage::class, + 'Unusedimages' => UnusedimagesPage::class, + 'Unusedtemplates' => UnusedtemplatesPage::class, + 'Unwatchedpages' => UnwatchedpagesPage::class, + 'Wantedcategories' => WantedCategoriesPage::class, + 'Wantedfiles' => WantedFilesPage::class, + 'Wantedpages' => WantedPagesPage::class, + 'Wantedtemplates' => WantedTemplatesPage::class, // List of pages - 'Allpages' => 'SpecialAllPages', - 'Prefixindex' => 'SpecialPrefixindex', - 'Categories' => 'SpecialCategories', - 'Listredirects' => 'ListredirectsPage', - 'PagesWithProp' => 'SpecialPagesWithProp', - 'TrackingCategories' => 'SpecialTrackingCategories', + 'Allpages' => SpecialAllPages::class, + 'Prefixindex' => SpecialPrefixindex::class, + 'Categories' => SpecialCategories::class, + 'Listredirects' => ListredirectsPage::class, + 'PagesWithProp' => SpecialPagesWithProp::class, + 'TrackingCategories' => SpecialTrackingCategories::class, // Authentication - 'Userlogin' => 'SpecialUserLogin', - 'Userlogout' => 'SpecialUserLogout', - 'CreateAccount' => 'SpecialCreateAccount', - 'LinkAccounts' => 'SpecialLinkAccounts', - 'UnlinkAccounts' => 'SpecialUnlinkAccounts', - 'ChangeCredentials' => 'SpecialChangeCredentials', - 'RemoveCredentials' => 'SpecialRemoveCredentials', + 'Userlogin' => SpecialUserLogin::class, + 'Userlogout' => SpecialUserLogout::class, + 'CreateAccount' => SpecialCreateAccount::class, + 'LinkAccounts' => SpecialLinkAccounts::class, + 'UnlinkAccounts' => SpecialUnlinkAccounts::class, + 'ChangeCredentials' => SpecialChangeCredentials::class, + 'RemoveCredentials' => SpecialRemoveCredentials::class, // Users and rights - 'Activeusers' => 'SpecialActiveUsers', - 'Block' => 'SpecialBlock', - 'Unblock' => 'SpecialUnblock', - 'BlockList' => 'SpecialBlockList', - 'AutoblockList' => 'SpecialAutoblockList', - 'ChangePassword' => 'SpecialChangePassword', - 'BotPasswords' => 'SpecialBotPasswords', - 'PasswordReset' => 'SpecialPasswordReset', - 'DeletedContributions' => 'DeletedContributionsPage', - 'Preferences' => 'SpecialPreferences', - 'ResetTokens' => 'SpecialResetTokens', - 'Contributions' => 'SpecialContributions', - 'Listgrouprights' => 'SpecialListGroupRights', - 'Listgrants' => 'SpecialListGrants', - 'Listusers' => 'SpecialListUsers', - 'Listadmins' => 'SpecialListAdmins', - 'Listbots' => 'SpecialListBots', - 'Userrights' => 'UserrightsPage', - 'EditWatchlist' => 'SpecialEditWatchlist', + 'Activeusers' => SpecialActiveUsers::class, + 'Block' => SpecialBlock::class, + 'Unblock' => SpecialUnblock::class, + 'BlockList' => SpecialBlockList::class, + 'AutoblockList' => SpecialAutoblockList::class, + 'ChangePassword' => SpecialChangePassword::class, + 'BotPasswords' => SpecialBotPasswords::class, + 'PasswordReset' => SpecialPasswordReset::class, + 'DeletedContributions' => DeletedContributionsPage::class, + 'Preferences' => SpecialPreferences::class, + 'ResetTokens' => SpecialResetTokens::class, + 'Contributions' => SpecialContributions::class, + 'Listgrouprights' => SpecialListGroupRights::class, + 'Listgrants' => SpecialListGrants::class, + 'Listusers' => SpecialListUsers::class, + 'Listadmins' => SpecialListAdmins::class, + 'Listbots' => SpecialListBots::class, + 'Userrights' => UserrightsPage::class, + 'EditWatchlist' => SpecialEditWatchlist::class, // Recent changes and logs - 'Newimages' => 'SpecialNewFiles', - 'Log' => 'SpecialLog', - 'Watchlist' => 'SpecialWatchlist', - 'Newpages' => 'SpecialNewpages', - 'Recentchanges' => 'SpecialRecentChanges', - 'Recentchangeslinked' => 'SpecialRecentChangesLinked', - 'Tags' => 'SpecialTags', + 'Newimages' => SpecialNewFiles::class, + 'Log' => SpecialLog::class, + 'Watchlist' => SpecialWatchlist::class, + 'Newpages' => SpecialNewpages::class, + 'Recentchanges' => SpecialRecentChanges::class, + 'Recentchangeslinked' => SpecialRecentChangesLinked::class, + 'Tags' => SpecialTags::class, // Media reports and uploads - 'Listfiles' => 'SpecialListFiles', - 'Filepath' => 'SpecialFilepath', - 'MediaStatistics' => 'MediaStatisticsPage', - 'MIMEsearch' => 'MIMEsearchPage', - 'FileDuplicateSearch' => 'FileDuplicateSearchPage', - 'Upload' => 'SpecialUpload', - 'UploadStash' => 'SpecialUploadStash', - 'ListDuplicatedFiles' => 'ListDuplicatedFilesPage', + 'Listfiles' => SpecialListFiles::class, + 'Filepath' => SpecialFilepath::class, + 'MediaStatistics' => MediaStatisticsPage::class, + 'MIMEsearch' => MIMEsearchPage::class, + 'FileDuplicateSearch' => FileDuplicateSearchPage::class, + 'Upload' => SpecialUpload::class, + 'UploadStash' => SpecialUploadStash::class, + 'ListDuplicatedFiles' => ListDuplicatedFilesPage::class, // Data and tools - 'ApiSandbox' => 'SpecialApiSandbox', - 'Statistics' => 'SpecialStatistics', - 'Allmessages' => 'SpecialAllMessages', - 'Version' => 'SpecialVersion', - 'Lockdb' => 'SpecialLockdb', - 'Unlockdb' => 'SpecialUnlockdb', + 'ApiSandbox' => SpecialApiSandbox::class, + 'Statistics' => SpecialStatistics::class, + 'Allmessages' => SpecialAllMessages::class, + 'Version' => SpecialVersion::class, + 'Lockdb' => SpecialLockdb::class, + 'Unlockdb' => SpecialUnlockdb::class, // Redirecting special pages - 'LinkSearch' => 'LinkSearchPage', - 'Randompage' => 'RandomPage', - 'RandomInCategory' => 'SpecialRandomInCategory', - 'Randomredirect' => 'SpecialRandomredirect', - 'Randomrootpage' => 'SpecialRandomrootpage', - 'GoToInterwiki' => 'SpecialGoToInterwiki', + 'LinkSearch' => LinkSearchPage::class, + 'Randompage' => RandomPage::class, + 'RandomInCategory' => SpecialRandomInCategory::class, + 'Randomredirect' => SpecialRandomredirect::class, + 'Randomrootpage' => SpecialRandomrootpage::class, + 'GoToInterwiki' => SpecialGoToInterwiki::class, // High use pages - 'Mostlinkedcategories' => 'MostlinkedCategoriesPage', - 'Mostimages' => 'MostimagesPage', - 'Mostinterwikis' => 'MostinterwikisPage', - 'Mostlinked' => 'MostlinkedPage', - 'Mostlinkedtemplates' => 'MostlinkedTemplatesPage', - 'Mostcategories' => 'MostcategoriesPage', - 'Mostrevisions' => 'MostrevisionsPage', + 'Mostlinkedcategories' => MostlinkedCategoriesPage::class, + 'Mostimages' => MostimagesPage::class, + 'Mostinterwikis' => MostinterwikisPage::class, + 'Mostlinked' => MostlinkedPage::class, + 'Mostlinkedtemplates' => MostlinkedTemplatesPage::class, + 'Mostcategories' => MostcategoriesPage::class, + 'Mostrevisions' => MostrevisionsPage::class, // Page tools - 'ComparePages' => 'SpecialComparePages', - 'Export' => 'SpecialExport', - 'Import' => 'SpecialImport', - 'Undelete' => 'SpecialUndelete', - 'Whatlinkshere' => 'SpecialWhatLinksHere', - 'MergeHistory' => 'SpecialMergeHistory', - 'ExpandTemplates' => 'SpecialExpandTemplates', + 'ComparePages' => SpecialComparePages::class, + 'Export' => SpecialExport::class, + 'Import' => SpecialImport::class, + 'Undelete' => SpecialUndelete::class, + 'Whatlinkshere' => SpecialWhatLinksHere::class, + 'MergeHistory' => SpecialMergeHistory::class, + 'ExpandTemplates' => SpecialExpandTemplates::class, // Other - 'Booksources' => 'SpecialBookSources', + 'Booksources' => SpecialBookSources::class, // Unlisted / redirects - 'ApiHelp' => 'SpecialApiHelp', - 'Blankpage' => 'SpecialBlankpage', - 'Diff' => 'SpecialDiff', - 'EditTags' => 'SpecialEditTags', - 'Emailuser' => 'SpecialEmailUser', - 'Movepage' => 'MovePageForm', - 'Mycontributions' => 'SpecialMycontributions', - 'MyLanguage' => 'SpecialMyLanguage', - 'Mypage' => 'SpecialMypage', - 'Mytalk' => 'SpecialMytalk', - 'Myuploads' => 'SpecialMyuploads', - 'AllMyUploads' => 'SpecialAllMyUploads', - 'PermanentLink' => 'SpecialPermanentLink', - 'Redirect' => 'SpecialRedirect', - 'Revisiondelete' => 'SpecialRevisionDelete', - 'RunJobs' => 'SpecialRunJobs', - 'Specialpages' => 'SpecialSpecialpages', - 'PageData' => 'SpecialPageData' + 'ApiHelp' => SpecialApiHelp::class, + 'Blankpage' => SpecialBlankpage::class, + 'Diff' => SpecialDiff::class, + 'EditTags' => SpecialEditTags::class, + 'Emailuser' => SpecialEmailUser::class, + 'Movepage' => MovePageForm::class, + 'Mycontributions' => SpecialMycontributions::class, + 'MyLanguage' => SpecialMyLanguage::class, + 'Mypage' => SpecialMypage::class, + 'Mytalk' => SpecialMytalk::class, + 'Myuploads' => SpecialMyuploads::class, + 'AllMyUploads' => SpecialAllMyUploads::class, + 'PermanentLink' => SpecialPermanentLink::class, + 'Redirect' => SpecialRedirect::class, + 'Revisiondelete' => SpecialRevisionDelete::class, + 'RunJobs' => SpecialRunJobs::class, + 'Specialpages' => SpecialSpecialpages::class, + 'PageData' => SpecialPageData::class, ]; private static $list; @@ -237,27 +237,27 @@ class SpecialPageFactory { self::$list = self::$coreList; if ( !$wgDisableInternalSearch ) { - self::$list['Search'] = 'SpecialSearch'; + self::$list['Search'] = SpecialSearch::class; } if ( $wgEmailAuthentication ) { - self::$list['Confirmemail'] = 'EmailConfirmation'; - self::$list['Invalidateemail'] = 'EmailInvalidation'; + self::$list['Confirmemail'] = EmailConfirmation::class; + self::$list['Invalidateemail'] = EmailInvalidation::class; } if ( $wgEnableEmail ) { - self::$list['ChangeEmail'] = 'SpecialChangeEmail'; + self::$list['ChangeEmail'] = SpecialChangeEmail::class; } if ( $wgEnableJavaScriptTest ) { - self::$list['JavaScriptTest'] = 'SpecialJavaScriptTest'; + self::$list['JavaScriptTest'] = SpecialJavaScriptTest::class; } if ( $wgPageLanguageUseDB ) { - self::$list['PageLanguage'] = 'SpecialPageLanguage'; + self::$list['PageLanguage'] = SpecialPageLanguage::class; } if ( $wgContentHandlerUseDB ) { - self::$list['ChangeContentModel'] = 'SpecialChangeContentModel'; + self::$list['ChangeContentModel'] = SpecialChangeContentModel::class; } // Add extension special pages diff --git a/includes/specials/SpecialBotPasswords.php b/includes/specials/SpecialBotPasswords.php index dfdbb067c0..f76c318e26 100644 --- a/includes/specials/SpecialBotPasswords.php +++ b/includes/specials/SpecialBotPasswords.php @@ -146,7 +146,7 @@ class SpecialBotPasswords extends FormSpecialPage { ]; $fields['restrictions'] = [ - 'class' => 'HTMLRestrictionsField', + 'class' => HTMLRestrictionsField::class, 'required' => true, 'default' => $this->botPassword->getRestrictions(), ]; diff --git a/includes/specials/SpecialDiff.php b/includes/specials/SpecialDiff.php index 28cd0d195a..b27a8b4dfd 100644 --- a/includes/specials/SpecialDiff.php +++ b/includes/specials/SpecialDiff.php @@ -78,7 +78,7 @@ class SpecialDiff extends RedirectSpecialPage { ], 'diff' => [ 'name' => 'diff', - 'class' => 'HTMLTextField', + 'class' => HTMLTextField::class, 'label-message' => 'diff-form-revid', ], ], $this->getContext(), 'diff-form' ); diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 09ea9ea6ac..e3c5d8c4a6 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -573,7 +573,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { // checkTitle can filter some options out, avoid empty sections if ( count( $options ) > 0 ) { $fields['TitlesNs' . $namespace] = [ - 'class' => 'EditWatchlistCheckboxSeriesField', + 'class' => EditWatchlistCheckboxSeriesField::class, 'options' => $options, 'section' => "ns$namespace", ]; diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index 78f92532a4..4b5dedf781 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -238,7 +238,7 @@ class SpecialExport extends SpecialPage { $formDescriptor += [ 'textarea' => [ - 'class' => 'HTMLTextAreaField', + 'class' => HTMLTextAreaField::class, 'name' => 'pages', 'label-message' => 'export-manual', 'nodata' => true, diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index ac34996283..d693b99007 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -97,7 +97,7 @@ class SpecialProtectedpages extends SpecialPage { ) { $formDescriptor = [ 'namespace' => [ - 'class' => 'HTMLSelectNamespace', + 'class' => HTMLSelectNamespace::class, 'name' => 'namespace', 'id' => 'namespace', 'cssclass' => 'namespaceselector', @@ -125,7 +125,7 @@ class SpecialProtectedpages extends SpecialPage { 'id' => 'noredirect', ], 'sizelimit' => [ - 'class' => 'HTMLSizeFilterField', + 'class' => HTMLSizeFilterField::class, 'name' => 'size', ] ]; diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index 605ee008d8..6b0598cefc 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -441,7 +441,7 @@ class SpecialTags extends SpecialPage { $out = $context->getOutput(); $tag = $data['HiddenTag']; - $status = call_user_func( [ 'ChangeTags', "{$form->tagAction}TagWithChecks" ], + $status = call_user_func( [ ChangeTags::class, "{$form->tagAction}TagWithChecks" ], $tag, $data['Reason'], $context->getUser(), true ); if ( $status->isGood() ) { diff --git a/includes/specials/forms/UploadForm.php b/includes/specials/forms/UploadForm.php index 44d91a8a26..eacdace18a 100644 --- a/includes/specials/forms/UploadForm.php +++ b/includes/specials/forms/UploadForm.php @@ -159,7 +159,7 @@ class UploadForm extends HTMLForm { } $descriptor['UploadFile'] = [ - 'class' => 'UploadSourceField', + 'class' => UploadSourceField::class, 'section' => 'source', 'type' => 'file', 'id' => 'wpUploadFile', @@ -174,7 +174,7 @@ class UploadForm extends HTMLForm { if ( $canUploadByUrl ) { $this->mMaxUploadSize['url'] = UploadBase::getMaxUploadSize( 'url' ); $descriptor['UploadFileURL'] = [ - 'class' => 'UploadSourceField', + 'class' => UploadSourceField::class, 'section' => 'source', 'id' => 'wpUploadFileURL', 'radio-id' => 'wpSourceTypeurl', @@ -322,7 +322,7 @@ class UploadForm extends HTMLForm { } else { $descriptor['License'] = [ 'type' => 'select', - 'class' => 'Licenses', + 'class' => Licenses::class, 'section' => 'description', 'id' => 'wpLicense', 'label-message' => 'license', diff --git a/includes/specials/pagers/UsersPager.php b/includes/specials/pagers/UsersPager.php index 4efe92d743..09d4b5e3eb 100644 --- a/includes/specials/pagers/UsersPager.php +++ b/includes/specials/pagers/UsersPager.php @@ -277,7 +277,7 @@ class UsersPager extends AlphabeticPager { $formDescriptor = [ 'user' => [ - 'class' => 'HTMLUserTextField', + 'class' => HTMLUserTextField::class, 'label' => $this->msg( 'listusersfrom' )->text(), 'name' => 'username', 'default' => $this->requestedUser, @@ -286,7 +286,7 @@ class UsersPager extends AlphabeticPager { 'label' => $this->msg( 'group' )->text(), 'name' => 'group', 'default' => $this->requestedGroup, - 'class' => 'HTMLSelectField', + 'class' => HTMLSelectField::class, 'options' => $groupOptions, ], 'editsOnly' => [ @@ -311,7 +311,7 @@ class UsersPager extends AlphabeticPager { 'default' => $this->mDefaultDirection ], 'limithiddenfield' => [ - 'class' => 'HTMLHiddenField', + 'class' => HTMLHiddenField::class, 'name' => 'limit', 'default' => $this->mLimit ] @@ -322,14 +322,14 @@ class UsersPager extends AlphabeticPager { if ( $beforeSubmitButtonHookOut !== '' ) { $formDescriptior[ 'beforeSubmitButtonHookOut' ] = [ - 'class' => 'HTMLInfoField', + 'class' => HTMLInfoField::class, 'raw' => true, 'default' => $beforeSubmitButtonHookOut ]; } $formDescriptor[ 'submit' ] = [ - 'class' => 'HTMLSubmitField', + 'class' => HTMLSubmitField::class, 'buttonlabel-message' => 'listusers-submit', ]; @@ -338,7 +338,7 @@ class UsersPager extends AlphabeticPager { if ( $beforeClosingFieldsetHookOut !== '' ) { $formDescriptior[ 'beforeClosingFieldsetHookOut' ] = [ - 'class' => 'HTMLInfoField', + 'class' => HTMLInfoField::class, 'raw' => true, 'default' => $beforeClosingFieldsetHookOut ]; diff --git a/includes/user/User.php b/includes/user/User.php index 5bab87642f..97035c2dab 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -3100,7 +3100,7 @@ class User implements IDBAccessObject, UserIdentity { $multiselectOptions = []; foreach ( $prefs as $name => $info ) { if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) || - ( isset( $info['class'] ) && $info['class'] == 'HTMLMultiSelectField' ) ) { + ( isset( $info['class'] ) && $info['class'] == HTMLMultiSelectField::class ) ) { $opts = HTMLFormField::flattenOptions( $info['options'] ); $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name; @@ -3114,7 +3114,7 @@ class User implements IDBAccessObject, UserIdentity { $checkmatrixOptions = []; foreach ( $prefs as $name => $info ) { if ( ( isset( $info['type'] ) && $info['type'] == 'checkmatrix' ) || - ( isset( $info['class'] ) && $info['class'] == 'HTMLCheckMatrix' ) ) { + ( isset( $info['class'] ) && $info['class'] == HTMLCheckMatrix::class ) ) { $columns = HTMLFormField::flattenOptions( $info['columns'] ); $rows = HTMLFormField::flattenOptions( $info['rows'] ); $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name; diff --git a/includes/watcheditem/WatchedItemStore.php b/includes/watcheditem/WatchedItemStore.php index c68d6d7fdf..d6d9ff0eb9 100644 --- a/includes/watcheditem/WatchedItemStore.php +++ b/includes/watcheditem/WatchedItemStore.php @@ -74,8 +74,8 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac $this->cache = $cache; $this->readOnlyMode = $readOnlyMode; $this->stats = new NullStatsdDataFactory(); - $this->deferredUpdatesAddCallableUpdateCallback = [ 'DeferredUpdates', 'addCallableUpdate' ]; - $this->revisionGetTimestampFromIdCallback = [ 'Revision', 'getTimestampFromId' ]; + $this->deferredUpdatesAddCallableUpdateCallback = [ DeferredUpdates::class, 'addCallableUpdate' ]; + $this->revisionGetTimestampFromIdCallback = [ Revision::class, 'getTimestampFromId' ]; } /** diff --git a/resources/Resources.php b/resources/Resources.php index e55e0fe002..5a16641589 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -29,18 +29,18 @@ return [ /** * Special modules who have their own classes */ - 'startup' => [ 'class' => 'ResourceLoaderStartUpModule' ], + 'startup' => [ 'class' => ResourceLoaderStartUpModule::class ], // Scripts managed by the local wiki (stored in the MediaWiki namespace) - 'site' => [ 'class' => 'ResourceLoaderSiteModule' ], - 'site.styles' => [ 'class' => 'ResourceLoaderSiteStylesModule' ], + 'site' => [ 'class' => ResourceLoaderSiteModule::class ], + 'site.styles' => [ 'class' => ResourceLoaderSiteStylesModule::class ], 'noscript' => [ - 'class' => 'ResourceLoaderWikiModule', + 'class' => ResourceLoaderWikiModule::class, 'styles' => [ 'MediaWiki:Noscript.css' ], 'group' => 'noscript', ], 'filepage' => [ - 'class' => 'ResourceLoaderWikiModule', + 'class' => ResourceLoaderWikiModule::class, 'styles' => [ 'MediaWiki:Filepage.css' ], ], 'user.groups' => [ @@ -50,16 +50,16 @@ return [ ], // Scripts managed by the current user (stored in their user space) - 'user' => [ 'class' => 'ResourceLoaderUserModule' ], - 'user.styles' => [ 'class' => 'ResourceLoaderUserStylesModule' ], + 'user' => [ 'class' => ResourceLoaderUserModule::class ], + 'user.styles' => [ 'class' => ResourceLoaderUserStylesModule::class ], // Populate mediawiki.user placeholders with information about the current user - 'user.defaults' => [ 'class' => 'ResourceLoaderUserDefaultsModule' ], - 'user.options' => [ 'class' => 'ResourceLoaderUserOptionsModule' ], - 'user.tokens' => [ 'class' => 'ResourceLoaderUserTokensModule' ], + 'user.defaults' => [ 'class' => ResourceLoaderUserDefaultsModule::class ], + 'user.options' => [ 'class' => ResourceLoaderUserOptionsModule::class ], + 'user.tokens' => [ 'class' => ResourceLoaderUserTokensModule::class ], // Scripts for the dynamic language specific data, like grammar forms. - 'mediawiki.language.data' => [ 'class' => 'ResourceLoaderLanguageDataModule' ], + 'mediawiki.language.data' => [ 'class' => ResourceLoaderLanguageDataModule::class ], /* MediaWiki base skinning modules */ @@ -105,7 +105,7 @@ return [ ], // Used in the web installer. Test it after modifying this definition! 'mediawiki.skinning.interface' => [ - 'class' => 'ResourceLoaderSkinModule', + 'class' => ResourceLoaderSkinModule::class, 'styles' => [ 'resources/src/mediawiki.skinning/elements.css' => [ 'media' => 'screen' ], 'resources/src/mediawiki.skinning/content.css' => [ 'media' => 'screen' ], @@ -832,7 +832,7 @@ return [ /* MediaWiki */ 'mediawiki' => [ - 'class' => 'ResourceLoaderRawFileModule', + 'class' => ResourceLoaderRawFileModule::class, // Keep in sync with maintenance/jsduck/eg-iframe.html 'scripts' => [ 'resources/src/mediawiki/mediawiki.js', @@ -1017,7 +1017,7 @@ return [ ], 'mediawiki.ForeignApi' => [ 'targets' => [ 'desktop', 'mobile' ], - 'class' => 'ResourceLoaderForeignApiModule', + 'class' => ResourceLoaderForeignApiModule::class, // Additional dependencies generated dynamically 'dependencies' => 'mediawiki.ForeignApi.core', ], @@ -1227,7 +1227,7 @@ return [ ] ], 'mediawiki.ForeignStructuredUpload.config' => [ - 'class' => 'ResourceLoaderUploadDialogModule', + 'class' => ResourceLoaderUploadDialogModule::class, ], 'mediawiki.ForeignStructuredUpload' => [ 'scripts' => 'resources/src/mediawiki/mediawiki.ForeignStructuredUpload.js', @@ -1366,7 +1366,7 @@ return [ ] ], 'mediawiki.util' => [ - 'class' => 'ResourceLoaderMediaWikiUtilModule', + 'class' => ResourceLoaderMediaWikiUtilModule::class, 'scripts' => 'resources/src/mediawiki/mediawiki.util.js', 'dependencies' => [ 'jquery.accessKeyLabel', @@ -1391,7 +1391,7 @@ return [ 'targets' => [ 'desktop', 'mobile' ], ], 'mediawiki.toolbar' => [ - 'class' => 'ResourceLoaderEditToolbarModule', + 'class' => ResourceLoaderEditToolbarModule::class, 'scripts' => 'resources/src/mediawiki.toolbar/toolbar.js', 'styles' => 'resources/src/mediawiki.toolbar/toolbar.less', 'dependencies' => 'jquery.textSelection', @@ -1596,7 +1596,7 @@ return [ 'mediawiki.jqueryMsg' => [ // Add data for mediawiki.jqueryMsg, such as allowed tags - 'class' => 'ResourceLoaderJqueryMsgModule', + 'class' => ResourceLoaderJqueryMsgModule::class, 'scripts' => 'resources/src/mediawiki/mediawiki.jqueryMsg.js', 'dependencies' => [ 'mediawiki.util', @@ -1616,10 +1616,10 @@ return [ ) ], - 'mediawiki.language.names' => [ 'class' => 'ResourceLoaderLanguageNamesModule' ], + 'mediawiki.language.names' => [ 'class' => ResourceLoaderLanguageNamesModule::class ], 'mediawiki.language.specialCharacters' => [ - 'class' => 'ResourceLoaderSpecialCharacterDataModule' + 'class' => ResourceLoaderSpecialCharacterDataModule::class ], /* MediaWiki Libs */ @@ -2724,7 +2724,7 @@ return [ // The core JavaScript library. 'oojs-ui-core' => [ - 'class' => 'ResourceLoaderOOUIFileModule', + 'class' => ResourceLoaderOOUIFileModule::class, 'scripts' => [ 'resources/lib/oojs-ui/oojs-ui-core.js', 'resources/src/oojs-ui-local.js', @@ -2744,7 +2744,7 @@ return [ ], // This contains only the styles required by core widgets. 'oojs-ui-core.styles' => [ - 'class' => 'ResourceLoaderOOUIFileModule', + 'class' => ResourceLoaderOOUIFileModule::class, 'styles' => [ 'resources/lib/oojs-ui/wikimedia-ui-base.less', // Providing Wikimedia UI LESS variables to all 'resources/src/oojs-ui-local.css', // HACK, see inside the file @@ -2754,7 +2754,7 @@ return [ ], // Additional widgets and layouts module. 'oojs-ui-widgets' => [ - 'class' => 'ResourceLoaderOOUIFileModule', + 'class' => ResourceLoaderOOUIFileModule::class, 'scripts' => 'resources/lib/oojs-ui/oojs-ui-widgets.js', 'themeStyles' => 'widgets', 'dependencies' => [ @@ -2779,7 +2779,7 @@ return [ ], // Toolbar and tools module. 'oojs-ui-toolbars' => [ - 'class' => 'ResourceLoaderOOUIFileModule', + 'class' => ResourceLoaderOOUIFileModule::class, 'scripts' => 'resources/lib/oojs-ui/oojs-ui-toolbars.js', 'themeStyles' => 'toolbars', 'dependencies' => [ @@ -2795,7 +2795,7 @@ return [ ], // Windows and dialogs module. 'oojs-ui-windows' => [ - 'class' => 'ResourceLoaderOOUIFileModule', + 'class' => ResourceLoaderOOUIFileModule::class, 'scripts' => 'resources/lib/oojs-ui/oojs-ui-windows.js', 'themeStyles' => 'windows', 'dependencies' => [ @@ -2814,71 +2814,71 @@ return [ ], 'oojs-ui.styles.indicators' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'indicators', ], 'oojs-ui.styles.textures' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'textures', ], 'oojs-ui.styles.icons-accessibility' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-accessibility', ], 'oojs-ui.styles.icons-alerts' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-alerts', ], 'oojs-ui.styles.icons-content' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-content', ], 'oojs-ui.styles.icons-editing-advanced' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-editing-advanced', ], 'oojs-ui.styles.icons-editing-core' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-editing-core', ], 'oojs-ui.styles.icons-editing-list' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-editing-list', ], 'oojs-ui.styles.icons-editing-styling' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-editing-styling', ], 'oojs-ui.styles.icons-interactions' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-interactions', ], 'oojs-ui.styles.icons-layout' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-layout', ], 'oojs-ui.styles.icons-location' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-location', ], 'oojs-ui.styles.icons-media' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-media', ], 'oojs-ui.styles.icons-moderation' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-moderation', ], 'oojs-ui.styles.icons-movement' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-movement', ], 'oojs-ui.styles.icons-user' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-user', ], 'oojs-ui.styles.icons-wikimedia' => [ - 'class' => 'ResourceLoaderOOUIImageModule', + 'class' => ResourceLoaderOOUIImageModule::class, 'themeImages' => 'icons-wikimedia', ], ];