Remove empty lines at end of functions
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoader.php
index 34a0a99..b05b51b 100644 (file)
@@ -388,7 +388,6 @@ class ResourceLoader implements LoggerAwareInterface {
                                }
                        }
                }
-
        }
 
        /**
@@ -428,7 +427,6 @@ class ResourceLoader implements LoggerAwareInterface {
                        // Keep track of their names so that they can be loaded together
                        $this->testModuleNames[$id] = array_keys( $testModules[$id] );
                }
-
        }
 
        /**
@@ -779,7 +777,6 @@ class ResourceLoader implements LoggerAwareInterface {
 
                $this->errors = [];
                echo $response;
-
        }
 
        /**
@@ -1009,6 +1006,7 @@ MESSAGE;
                foreach ( $modules as $name => $module ) {
                        try {
                                $content = $module->getModuleContent( $context );
+                               $implementKey = $name . '@' . $module->getVersionHash( $context );
                                $strContent = '';
 
                                // Append output
@@ -1020,7 +1018,7 @@ MESSAGE;
                                                        $strContent = $scripts;
                                                } elseif ( is_array( $scripts ) ) {
                                                        // ...except when $scripts is an array of URLs
-                                                       $strContent = self::makeLoaderImplementScript( $name, $scripts, [], [], [] );
+                                                       $strContent = self::makeLoaderImplementScript( $implementKey, $scripts, [], [], [] );
                                                }
                                                break;
                                        case 'styles':
@@ -1046,7 +1044,7 @@ MESSAGE;
                                                        }
                                                }
                                                $strContent = self::makeLoaderImplementScript(
-                                                       $name,
+                                                       $implementKey,
                                                        $scripts,
                                                        isset( $content['styles'] ) ? $content['styles'] : [],
                                                        isset( $content['messagesBlob'] ) ? new XmlJsCode( $content['messagesBlob'] ) : [],
@@ -1125,7 +1123,7 @@ MESSAGE;
        /**
         * Return JS code that calls mw.loader.implement with given module properties.
         *
-        * @param string $name Module name
+        * @param string $name Module name or implement key (format "`[name]@[version]`")
         * @param XmlJsCode|array|string $scripts Code as XmlJsCode (to be wrapped in a closure),
         *  list of URLs to JavaScript files, or a string of JavaScript for `$.globalEval`.
         * @param mixed $styles Array of CSS strings keyed by media type, or an array of lists of URLs
@@ -1141,7 +1139,6 @@ MESSAGE;
        protected static function makeLoaderImplementScript(
                $name, $scripts, $styles, $messages, $templates
        ) {
-
                if ( $scripts instanceof XmlJsCode ) {
                        $scripts = new XmlJsCode( "function ( $, jQuery, require, module ) {\n{$scripts->value}\n}" );
                } elseif ( !is_string( $scripts ) && !is_array( $scripts ) ) {