From 440dfcf6d87e127e91d93bbf9bb0c024c0c2c071 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 1 Aug 2019 15:53:31 -0400 Subject: [PATCH] Reorganize ResourceLoader fields Change-Id: I9c9aece69b869165b8d9037336c8a2e7d7189c1e --- includes/resourceloader/ResourceLoader.php | 66 +++++++--------------- 1 file changed, 21 insertions(+), 45 deletions(-) diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index b05068c610..9892b15705 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -36,65 +36,41 @@ use Wikimedia\WrappedString; * https://www.mediawiki.org/wiki/ResourceLoader */ class ResourceLoader implements LoggerAwareInterface { - /** @var int */ - const CACHE_VERSION = 8; + /** @var Config $config */ + protected $config; + /** @var MessageBlobStore */ + protected $blobStore; - /** @var bool */ - protected static $debugMode = null; + /** @var LoggerInterface */ + private $logger; - /** - * Module name/ResourceLoaderModule object pairs - * @var array - */ + /** @var ResourceLoaderModule[] Map of (module name => ResourceLoaderModule) */ protected $modules = []; - - /** - * Associative array mapping module name to info associative array - * @var array - */ + /** @var array[] Map of (module name => associative info array) */ protected $moduleInfos = []; - - /** @var Config $config */ - protected $config; - /** - * List of module names that contain QUnit test suites - * @var string[] + * Associative array mapping framework ids to a list of names of test suite modules + * like [ 'qunit' => [ 'mediawiki.tests.qunit.suites', 'ext.foo.tests', ... ], ... ] + * @var array */ + protected $testModuleNames = []; + /** @var string[] List of module names that contain QUnit test suites */ protected $testSuiteModuleNames = []; - /** - * E.g. [ 'source-id' => 'http://.../load.php' ] - * @var array - */ + /** @var array Map of (source => path); E.g. [ 'source-id' => 'http://.../load.php' ] */ protected $sources = []; - - /** - * Errors accumulated during current respond() call. - * @var array - */ + /** @var array Errors accumulated during current respond() call */ protected $errors = []; - - /** - * List of extra HTTP response headers provided by loaded modules. - * - * Populated by makeModuleResponse(). - * - * @var array - */ + /** @var string[] Extra HTTP response headers from modules loaded in makeModuleResponse() */ protected $extraHeaders = []; - /** - * @var MessageBlobStore - */ - protected $blobStore; + /** @var bool */ + protected static $debugMode = null; - /** - * @var LoggerInterface - */ - private $logger; + /** @var int */ + const CACHE_VERSION = 8; - /** @var string JavaScript / CSS pragma to disable minification. **/ + /** @var string JavaScript / CSS pragma to disable minification. * */ const FILTER_NOMIN = '/*@nomin*/'; /** -- 2.20.1