Index: trunk/phase3/includes/ResourceLoader.php |
— | — | @@ -15,11 +15,12 @@ |
16 | 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | 17 | * http://www.gnu.org/copyleft/gpl.html |
18 | 18 | * |
| 19 | + * @file |
19 | 20 | * @author Roan Kattouw |
20 | 21 | * @author Trevor Parscal |
21 | 22 | */ |
22 | 23 | |
23 | | -/* |
| 24 | +/** |
24 | 25 | * Dynamic JavaScript and CSS resource loading system |
25 | 26 | * |
26 | 27 | * @example |
— | — | @@ -27,10 +28,10 @@ |
28 | 29 | * ResourceLoader::register( 'foo', array( |
29 | 30 | * // Script or list of scripts to include when implementating the module (required) |
30 | 31 | * 'script' => 'resources/foo/foo.js', |
31 | | - * // List of scripts or lists of scripts to include based on the current language |
32 | | - * 'locales' => array( |
33 | | - * 'en-gb' => 'resources/foo/locales/en-gb.js', |
34 | | - * ), |
| 32 | + * // List of scripts or lists of scripts to include based on the current language |
| 33 | + * 'locales' => array( |
| 34 | + * 'en-gb' => 'resources/foo/locales/en-gb.js', |
| 35 | + * ), |
35 | 36 | * // Script or list of scripts to include only when in debug mode |
36 | 37 | * 'debug' => 'resources/foo/debug.js', |
37 | 38 | * // If this module is going to be loaded before the mediawiki module is ready such as jquery or the mediawiki |
— | — | @@ -45,16 +46,16 @@ |
46 | 47 | * 'loader' => 'resources/foo/loader.js', |
47 | 48 | * // Style-sheets or list of style-sheets to include |
48 | 49 | * 'style' => 'resources/foo/foo.css', |
49 | | - * // List of style-sheets or lists of style-sheets to include based on the skin - if no match is found for current |
50 | | - * // skin, 'default' is used - if default doesn't exist nothing is added |
51 | | - * 'themes' => array( |
52 | | - * 'default' => 'resources/foo/themes/default/foo.css', |
53 | | - * 'vector' => 'resources/foo/themes/vector.foo.css', |
54 | | - * ), |
| 50 | + * // List of style-sheets or lists of style-sheets to include based on the skin - if no match is found for current |
| 51 | + * // skin, 'default' is used - if default doesn't exist nothing is added |
| 52 | + * 'themes' => array( |
| 53 | + * 'default' => 'resources/foo/themes/default/foo.css', |
| 54 | + * 'vector' => 'resources/foo/themes/vector.foo.css', |
| 55 | + * ), |
55 | 56 | * // List of keys of messages to include |
56 | 57 | * 'messages' => array( 'foo-hello', 'foo-goodbye' ), |
57 | 58 | * // Subclass of ResourceLoaderModule to use for custom modules |
58 | | - * 'class' => 'ResourceLoaderSiteJSModule', |
| 59 | + * 'class' => 'ResourceLoaderSiteJSModule', |
59 | 60 | * ) ); |
60 | 61 | * @example |
61 | 62 | * // Responds to a resource loading request |
— | — | @@ -71,10 +72,10 @@ |
72 | 73 | /** |
73 | 74 | * Runs text through a filter, caching the filtered result for future calls |
74 | 75 | * |
75 | | - * @param {string} $filter name of filter to run |
76 | | - * @param {string} $data text to filter, such as JavaScript or CSS text |
77 | | - * @param {string} $file path to file being filtered, (optional: only required for CSS to resolve paths) |
78 | | - * @return {string} filtered data |
| 76 | + * @param $filter String: name of filter to run |
| 77 | + * @param $data String: text to filter, such as JavaScript or CSS text |
| 78 | + * @param $file String: path to file being filtered, (optional: only required for CSS to resolve paths) |
| 79 | + * @return String: filtered data |
79 | 80 | */ |
80 | 81 | protected static function filter( $filter, $data ) { |
81 | 82 | global $wgMemc; |
— | — | @@ -126,9 +127,9 @@ |
127 | 128 | * Note that registering the same object under multiple names is not supported and may silently fail in all |
128 | 129 | * kinds of interesting ways. |
129 | 130 | * |
130 | | - * @param {mixed} $name string of name of module or array of name/object pairs |
131 | | - * @param {ResourceLoaderModule} $object module object (optional when using multiple-registration calling style) |
132 | | - * @return {boolean} false if there were any errors, in which case one or more modules were not registered |
| 131 | + * @param $name Mixed: string of name of module or array of name/object pairs |
| 132 | + * @param $object ResourceLoaderModule: module object (optional when using multiple-registration calling style) |
| 133 | + * @return Boolean: false if there were any errors, in which case one or more modules were not registered |
133 | 134 | * |
134 | 135 | * @todo We need much more clever error reporting, not just in detailing what happened, but in bringing errors to |
135 | 136 | * the client in a way that they can easily see them if they want to, such as by using FireBug |
— | — | @@ -156,7 +157,7 @@ |
157 | 158 | /** |
158 | 159 | * Gets a map of all modules and their options |
159 | 160 | * |
160 | | - * @return {array} array( modulename => ResourceLoaderModule ) |
| 161 | + * @return Array: array( modulename => ResourceLoaderModule ) |
161 | 162 | */ |
162 | 163 | public static function getModules() { |
163 | 164 | return self::$modules; |
— | — | @@ -164,7 +165,8 @@ |
165 | 166 | |
166 | 167 | /** |
167 | 168 | * Get the ResourceLoaderModule object for a given module name |
168 | | - * @param $name string Module name |
| 169 | + * |
| 170 | + * @param $name String: module name |
169 | 171 | * @return mixed ResourceLoaderModule or null if not registered |
170 | 172 | */ |
171 | 173 | public static function getModule( $name ) { |
— | — | @@ -174,12 +176,8 @@ |
175 | 177 | /** |
176 | 178 | * Gets registration code for all modules, except pre-registered ones listed in self::$preRegisteredModules |
177 | 179 | * |
178 | | - * The $lang, $skin and $debug parameters are used to calculate the last modified timestamps for each |
179 | | - * module. |
180 | | - * @param $lang string Language code |
181 | | - * @param $skin string Skin name |
182 | | - * @param $debug bool Debug mode flag |
183 | | - * @return {string} JavaScript code for registering all modules with the client loader |
| 180 | + * @param $context ResourceLoaderContext object |
| 181 | + * @return String: JavaScript code for registering all modules with the client loader |
184 | 182 | */ |
185 | 183 | public static function getModuleRegistrations( ResourceLoaderContext $context ) { |
186 | 184 | $scripts = ''; |
— | — | @@ -208,10 +206,9 @@ |
209 | 207 | /** |
210 | 208 | * Get the highest modification time of all modules, based on a given combination of language code, |
211 | 209 | * skin name and debug mode flag. |
212 | | - * @param $lang string Language code |
213 | | - * @param $skin string Skin name |
214 | | - * @param $debug bool Debug mode flag |
215 | | - * @return int UNIX timestamp |
| 210 | + * |
| 211 | + * @param $context ResourceLoaderContext object |
| 212 | + * @return Integer: UNIX timestamp |
216 | 213 | */ |
217 | 214 | public static function getHighestModifiedTime( ResourceLoaderContext $context ) { |
218 | 215 | $time = 1; // wfTimestamp() treats 0 as 'now', so that's not a suitable choice |
— | — | @@ -223,22 +220,10 @@ |
224 | 221 | return $time; |
225 | 222 | } |
226 | 223 | |
227 | | - /* Methods */ |
228 | | - |
229 | | - /* |
| 224 | + /** |
230 | 225 | * Outputs a response to a resource load-request, including a content-type header |
231 | 226 | * |
232 | | - * @param {WebRequest} $request web request object to respond to |
233 | | - * @param {string} $server web-accessible path to script server |
234 | | - * |
235 | | - * $options format: |
236 | | - * array( |
237 | | - * 'lang' => [string: language code, optional, code of default language by default], |
238 | | - * 'skin' => [string: name of skin, optional, name of default skin by default], |
239 | | - * 'dir' => [string: 'ltr' or 'rtl', optional, direction of lang by default], |
240 | | - * 'debug' => [boolean: true to include debug-only scripts, optional, false by default], |
241 | | - * 'only' => [string: 'scripts', 'styles' or 'messages', optional, if set only get part of the requested module] |
242 | | - * ) |
| 227 | + * @param $context ResourceLoaderContext object |
243 | 228 | */ |
244 | 229 | public static function respond( ResourceLoaderContext $context ) { |
245 | 230 | // Split requested modules into two groups, modules and missing |
Index: trunk/phase3/includes/ResourceLoaderModule.php |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | 17 | * http://www.gnu.org/copyleft/gpl.html |
18 | 18 | * |
| 19 | + * @file |
19 | 20 | * @author Trevor Parscal |
20 | 21 | * @author Roan Kattouw |
21 | 22 | */ |
— | — | @@ -32,7 +33,8 @@ |
33 | 34 | /** |
34 | 35 | * Get this module's name. This is set when the module is registered |
35 | 36 | * with ResourceLoader::register() |
36 | | - * @return mixed Name (string) or null if no name was set |
| 37 | + * |
| 38 | + * @return Mixed: name (string) or null if no name was set |
37 | 39 | */ |
38 | 40 | public function getName() { |
39 | 41 | return $this->name; |
— | — | @@ -41,7 +43,8 @@ |
42 | 44 | /** |
43 | 45 | * Set this module's name. This is called by ResourceLodaer::register() |
44 | 46 | * when registering the module. Other code should not call this. |
45 | | - * @param $name string Name |
| 47 | + * |
| 48 | + * @param $name String: name |
46 | 49 | */ |
47 | 50 | public function setName( $name ) { |
48 | 51 | $this->name = $name; |
— | — | @@ -51,7 +54,8 @@ |
52 | 55 | * The maximum number of seconds to cache this module for in the |
53 | 56 | * client-side (browser) cache. Override this only if you have a good |
54 | 57 | * reason not to use $wgResourceLoaderClientMaxage. |
55 | | - * @return int Cache maxage in seconds |
| 58 | + * |
| 59 | + * @return Integer: cache maxage in seconds |
56 | 60 | */ |
57 | 61 | public function getClientMaxage() { |
58 | 62 | global $wgResourceLoaderClientMaxage; |
— | — | @@ -62,7 +66,8 @@ |
63 | 67 | * The maximum number of seconds to cache this module for in the |
64 | 68 | * server-side (Squid / proxy) cache. Override this only if you have a |
65 | 69 | * good reason not to use $wgResourceLoaderServerMaxage. |
66 | | - * @return int Cache maxage in seconds |
| 70 | + * |
| 71 | + * @return Integer: cache maxage in seconds |
67 | 72 | */ |
68 | 73 | public function getServerMaxage() { |
69 | 74 | global $wgResourceLoaderServerMaxage; |
— | — | @@ -81,17 +86,17 @@ |
82 | 87 | /** |
83 | 88 | * Get all JS for this module for a given language and skin. |
84 | 89 | * Includes all relevant JS except loader scripts. |
85 | | - * @param $lang string Language code |
86 | | - * @param $skin string Skin name |
87 | | - * @param $debug bool Whether to include debug scripts |
88 | | - * @return string JS |
| 90 | + * |
| 91 | + * @param $context ResourceLoaderContext object |
| 92 | + * @return String: JS |
89 | 93 | */ |
90 | 94 | public abstract function getScript( ResourceLoaderContext $context ); |
91 | 95 | |
92 | 96 | /** |
93 | 97 | * Get all CSS for this module for a given skin. |
94 | | - * @param $skin string Skin name |
95 | | - * @return string CSS |
| 98 | + * |
| 99 | + * @param $context ResourceLoaderContext object |
| 100 | + * @return String: CSS |
96 | 101 | */ |
97 | 102 | public abstract function getStyle( ResourceLoaderContext $context ); |
98 | 103 | |
— | — | @@ -99,13 +104,15 @@ |
100 | 105 | * Get the messages needed for this module. |
101 | 106 | * |
102 | 107 | * To get a JSON blob with messages, use MessageBlobStore::get() |
| 108 | + * |
103 | 109 | * @return array of message keys. Keys may occur more than once |
104 | 110 | */ |
105 | 111 | public abstract function getMessages(); |
106 | 112 | |
107 | 113 | /** |
108 | 114 | * Get the loader JS for this module, if set. |
109 | | - * @return mixed Loader JS (string) or false if no custom loader set |
| 115 | + * |
| 116 | + * @return Mixed: loader JS (string) or false if no custom loader set |
110 | 117 | */ |
111 | 118 | public abstract function getLoaderScript(); |
112 | 119 | |
— | — | @@ -122,7 +129,7 @@ |
123 | 130 | * |
124 | 131 | * To add dependencies dynamically on the client side, use a custom |
125 | 132 | * loader script, see getLoaderScript() |
126 | | - * @return array Array of module names (strings) |
| 133 | + * @return Array of module names (strings) |
127 | 134 | */ |
128 | 135 | public abstract function getDependencies(); |
129 | 136 | |
— | — | @@ -132,9 +139,8 @@ |
133 | 140 | * the highest of each of the relevant components' modification |
134 | 141 | * timestamps. Whenever anything happens that changes the module's |
135 | 142 | * contents for these parameters, the mtime should increase. |
136 | | - * @param $lang string Language code |
137 | | - * @param $skin string Skin name |
138 | | - * @param $debug bool Debug mode flag |
| 143 | + * |
| 144 | + * @param $context ResourceLoaderContext object |
139 | 145 | * @return int UNIX timestamp |
140 | 146 | */ |
141 | 147 | public abstract function getModifiedTime( ResourceLoaderContext $context ); |
— | — | @@ -230,7 +236,8 @@ |
231 | 237 | /** |
232 | 238 | * Add script files to this module. In order to be valid, a module |
233 | 239 | * must contain at least one script file. |
234 | | - * @param $scripts mixed Path to script file (string) or array of paths |
| 240 | + * |
| 241 | + * @param $scripts Mixed: path to script file (string) or array of paths |
235 | 242 | */ |
236 | 243 | public function addScripts( $scripts ) { |
237 | 244 | $this->scripts = array_merge( $this->scripts, (array)$scripts ); |
— | — | @@ -238,7 +245,8 @@ |
239 | 246 | |
240 | 247 | /** |
241 | 248 | * Add style (CSS) files to this module. |
242 | | - * @param $styles mixed Path to CSS file (string) or array of paths |
| 249 | + * |
| 250 | + * @param $styles Mixed: path to CSS file (string) or array of paths |
243 | 251 | */ |
244 | 252 | public function addStyles( $styles ) { |
245 | 253 | $this->styles = array_merge( $this->styles, (array)$styles ); |
— | — | @@ -246,7 +254,8 @@ |
247 | 255 | |
248 | 256 | /** |
249 | 257 | * Add messages to this module. |
250 | | - * @param $messages mixed Message key (string) or array of message keys |
| 258 | + * |
| 259 | + * @param $messages Mixed: message key (string) or array of message keys |
251 | 260 | */ |
252 | 261 | public function addMessages( $messages ) { |
253 | 262 | $this->messages = array_merge( $this->messages, (array)$messages ); |
— | — | @@ -264,7 +273,7 @@ |
265 | 274 | * To add dependencies dynamically on the client side, use a custom |
266 | 275 | * loader (see addLoaders()) |
267 | 276 | * |
268 | | - * @param $dependencies mixed Module name (string) or array of module names |
| 277 | + * @param $dependencies Mixed: module name (string) or array of module names |
269 | 278 | */ |
270 | 279 | public function addDependencies( $dependencies ) { |
271 | 280 | $this->dependencies = array_merge( $this->dependencies, (array)$dependencies ); |
— | — | @@ -273,7 +282,8 @@ |
274 | 283 | /** |
275 | 284 | * Add debug scripts to the module. These scripts are only included |
276 | 285 | * in debug mode. |
277 | | - * @param $scripts mixed Path to script file (string) or array of paths |
| 286 | + * |
| 287 | + * @param $scripts Mixed: path to script file (string) or array of paths |
278 | 288 | */ |
279 | 289 | public function addDebugScripts( $scripts ) { |
280 | 290 | $this->debugScripts = array_merge( $this->debugScripts, (array)$scripts ); |
— | — | @@ -282,8 +292,9 @@ |
283 | 293 | /** |
284 | 294 | * Add language-specific scripts. These scripts are only included for |
285 | 295 | * a given language. |
286 | | - * @param $lang string Language code |
287 | | - * @param $scripts mixed Path to script file (string) or array of paths |
| 296 | + * |
| 297 | + * @param $lang String: language code |
| 298 | + * @param $scripts Mixed: path to script file (string) or array of paths |
288 | 299 | */ |
289 | 300 | public function addLanguageScripts( $lang, $scripts ) { |
290 | 301 | $this->languageScripts = array_merge_recursive( |
— | — | @@ -295,8 +306,9 @@ |
296 | 307 | /** |
297 | 308 | * Add skin-specific scripts. These scripts are only included for |
298 | 309 | * a given skin. |
299 | | - * @param $skin string Skin name, or 'default' |
300 | | - * @param $scripts mixed Path to script file (string) or array of paths |
| 310 | + * |
| 311 | + * @param $skin String: skin name, or 'default' |
| 312 | + * @param $scripts Mixed: path to script file (string) or array of paths |
301 | 313 | */ |
302 | 314 | public function addSkinScripts( $skin, $scripts ) { |
303 | 315 | $this->skinScripts = array_merge_recursive( |
— | — | @@ -309,8 +321,9 @@ |
310 | 322 | * Add skin-specific CSS. These CSS files are only included for a |
311 | 323 | * given skin. If there are no skin-specific CSS files for a skin, |
312 | 324 | * the files defined for 'default' will be used, if any. |
313 | | - * @param $skin string Skin name, or 'default' |
314 | | - * @param $scripts mixed Path to CSS file (string) or array of paths |
| 325 | + * |
| 326 | + * @param $skin String: skin name, or 'default' |
| 327 | + * @param $scripts Mixed: path to CSS file (string) or array of paths |
315 | 328 | */ |
316 | 329 | public function addSkinStyles( $skin, $scripts ) { |
317 | 330 | $this->skinStyles = array_merge_recursive( |
— | — | @@ -330,7 +343,8 @@ |
331 | 344 | * Note that loader scripts are included on every page, so they should |
332 | 345 | * be lightweight and use mediaWiki.loader.register()'s callback |
333 | 346 | * feature to defer dependency calculation. |
334 | | - * @param $scripts mixed Path to script file (string) or array of paths |
| 347 | + * |
| 348 | + * @param $scripts Mixed: path to script file (string) or array of paths |
335 | 349 | */ |
336 | 350 | public function addLoaders( $scripts ) { |
337 | 351 | $this->loaders = array_merge( $this->loaders, (array)$scripts ); |
— | — | @@ -399,10 +413,9 @@ |
400 | 414 | * relevant to the given language and skin are taken into account, and |
401 | 415 | * files only relevant in debug mode are not taken into account when |
402 | 416 | * debug mode is off. |
403 | | - * @param $lang string Language code |
404 | | - * @param $skin string Skin name |
405 | | - * @param $debug bool Debug mode flag |
406 | | - * @return int UNIX timestamp |
| 417 | + * |
| 418 | + * @param $context ResourceLoaderContext object |
| 419 | + * @return Integer: UNIX timestamp |
407 | 420 | */ |
408 | 421 | public function getModifiedTime( ResourceLoaderContext $context ) { |
409 | 422 | if ( isset( $this->modifiedTime[$context->getHash()] ) ) { |
— | — | @@ -442,7 +455,8 @@ |
443 | 456 | /** |
444 | 457 | * Get the primary JS for this module. This is pulled from the |
445 | 458 | * script files added through addScripts() |
446 | | - * @return string JS |
| 459 | + * |
| 460 | + * @return String: JS |
447 | 461 | */ |
448 | 462 | protected function getPrimaryScript() { |
449 | 463 | return self::concatScripts( $this->scripts ); |
— | — | @@ -451,7 +465,8 @@ |
452 | 466 | /** |
453 | 467 | * Get the primary CSS for this module. This is pulled from the CSS |
454 | 468 | * files added through addStyles() |
455 | | - * @return string JS |
| 469 | + * |
| 470 | + * @return String: JS |
456 | 471 | */ |
457 | 472 | protected function getPrimaryStyle() { |
458 | 473 | return self::concatStyles( $this->styles ); |
— | — | @@ -460,7 +475,8 @@ |
461 | 476 | /** |
462 | 477 | * Get the debug JS for this module. This is pulled from the script |
463 | 478 | * files added through addDebugScripts() |
464 | | - * @return string JS |
| 479 | + * |
| 480 | + * @return String: JS |
465 | 481 | */ |
466 | 482 | protected function getDebugScript() { |
467 | 483 | return self::concatScripts( $this->debugScripts ); |
— | — | @@ -469,7 +485,8 @@ |
470 | 486 | /** |
471 | 487 | * Get the language-specific JS for a given language. This is pulled |
472 | 488 | * from the language-specific script files added through addLanguageScripts() |
473 | | - * @return string JS |
| 489 | + * |
| 490 | + * @return String: JS |
474 | 491 | */ |
475 | 492 | protected function getLanguageScript( $lang ) { |
476 | 493 | if ( !isset( $this->languageScripts[$lang] ) ) { |
— | — | @@ -481,7 +498,8 @@ |
482 | 499 | /** |
483 | 500 | * Get the skin-specific JS for a given skin. This is pulled from the |
484 | 501 | * skin-specific JS files added through addSkinScripts() |
485 | | - * @return string JS |
| 502 | + * |
| 503 | + * @return String: JS |
486 | 504 | */ |
487 | 505 | protected function getSkinScript( $skin ) { |
488 | 506 | return self::concatScripts( self::getSkinFiles( $skin, $this->skinScripts ) ); |
— | — | @@ -490,7 +508,8 @@ |
491 | 509 | /** |
492 | 510 | * Get the skin-specific CSS for a given skin. This is pulled from the |
493 | 511 | * skin-specific CSS files added through addSkinStyles() |
494 | | - * @return string CSS |
| 512 | + * |
| 513 | + * @return String: CSS |
495 | 514 | */ |
496 | 515 | protected function getSkinStyle( $skin ) { |
497 | 516 | return self::concatStyles( self::getSkinFiles( $skin, $this->skinStyles ) ); |
— | — | @@ -498,8 +517,9 @@ |
499 | 518 | |
500 | 519 | /** |
501 | 520 | * Helper function to get skin-specific data from an array. |
502 | | - * @param $skin string Skin name |
503 | | - * @param $map array Map of skin names to arrays |
| 521 | + * |
| 522 | + * @param $skin String: skin name |
| 523 | + * @param $map Array: map of skin names to arrays |
504 | 524 | * @return $map[$skin] if set and non-empty, or $map['default'] if set, or an empty array |
505 | 525 | */ |
506 | 526 | protected static function getSkinFiles( $skin, $map ) { |
— | — | @@ -517,7 +537,8 @@ |
518 | 538 | /** |
519 | 539 | * Get the files this module depends on indirectly for a given skin. |
520 | 540 | * Currently these are only image files referenced by the module's CSS. |
521 | | - * @param $skin string Skin name |
| 541 | + * |
| 542 | + * @param $skin String: skin name |
522 | 543 | * @return array of files |
523 | 544 | */ |
524 | 545 | protected function getFileDependencies( $skin ) { |
— | — | @@ -553,8 +574,9 @@ |
554 | 575 | /** |
555 | 576 | * Get the contents of a set of files and concatenate them, with |
556 | 577 | * newlines in between. Each file is used only once. |
557 | | - * @param $files array Array of file names |
558 | | - * @return string Concatenated contents of $files |
| 578 | + * |
| 579 | + * @param $files Array of file names |
| 580 | + * @return String: concatenated contents of $files |
559 | 581 | */ |
560 | 582 | protected static function concatScripts( $files ) { |
561 | 583 | return implode( "\n", array_map( 'file_get_contents', array_map( array( __CLASS__, 'remapFilename' ), array_unique( (array) $files ) ) ) ); |
— | — | @@ -563,8 +585,9 @@ |
564 | 586 | /** |
565 | 587 | * Get the contents of a set of CSS files, remap then and concatenate |
566 | 588 | * them, with newlines in between. Each file is used only once. |
567 | | - * @param $files array Array of file names |
568 | | - * @return string Concatenated and remapped contents of $files |
| 589 | + * |
| 590 | + * @param $files Array of file names |
| 591 | + * @return String: concatenated and remapped contents of $files |
569 | 592 | */ |
570 | 593 | protected static function concatStyles( $files ) { |
571 | 594 | return implode( "\n", array_map( array( __CLASS__, 'remapStyle' ), array_unique( (array) $files ) ) ); |
— | — | @@ -572,7 +595,8 @@ |
573 | 596 | |
574 | 597 | /** |
575 | 598 | * Remap a relative to $IP. Used as a callback for array_map() |
576 | | - * @param $file string File name |
| 599 | + * |
| 600 | + * @param $file String: file name |
577 | 601 | * @return string $IP/$file |
578 | 602 | */ |
579 | 603 | protected static function remapFilename( $file ) { |
— | — | @@ -584,7 +608,8 @@ |
585 | 609 | /** |
586 | 610 | * Get the contents of a CSS file and run it through CSSMin::remap(). |
587 | 611 | * This wrapper is needed so we can use array_map() in concatStyles() |
588 | | - * @param $file string File name |
| 612 | + * |
| 613 | + * @param $file String: file name |
589 | 614 | * @return string Remapped CSS |
590 | 615 | */ |
591 | 616 | protected static function remapStyle( $file ) { |