Avoid dynamic call to static method in ResourceLoaderModule::buildContent()
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderModule.php
index 38084bf..b4a0f46 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Abstraction for ResourceLoader modules.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -32,6 +30,9 @@ use Wikimedia\ScopedCallback;
 
 /**
  * Abstraction for ResourceLoader modules, with name registration and maxage functionality.
+ *
+ * @ingroup ResourceLoader
+ * @since 1.17
  */
 abstract class ResourceLoaderModule implements LoggerAwareInterface {
        /** @var Config */
@@ -127,7 +128,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * @param ResourceLoaderContext $context
         * @return bool
         */
-       public function getFlip( $context ) {
+       public function getFlip( ResourceLoaderContext $context ) {
                return MediaWikiServices::getInstance()->getContentLanguage()->getDir() !==
                        $context->getDirection();
        }
@@ -696,7 +697,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * @return array
         */
        final protected function buildContent( ResourceLoaderContext $context ) {
-               $rl = $context->getResourceLoader();
                $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
                $statStart = microtime( true );
 
@@ -765,7 +765,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                                }
                                // Wrap styles into @media groups as needed and flatten into a numerical array
                                $styles = [
-                                       'css' => $rl->makeCombinedStyles( $stylePairs )
+                                       'css' => ResourceLoader::makeCombinedStyles( $stylePairs )
                                ];
                        }
                }