Reorganize ResourceLoader fields
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 1 Aug 2019 19:53:31 +0000 (15:53 -0400)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 2 Aug 2019 18:54:40 +0000 (14:54 -0400)
Change-Id: I9c9aece69b869165b8d9037336c8a2e7d7189c1e

includes/resourceloader/ResourceLoader.php

index b05068c..9892b15 100644 (file)
@@ -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*/';
 
        /**