Merge "Don't return a result of a void function"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderFileModule.php
index 6680777..9be5de3 100644 (file)
@@ -198,10 +198,11 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         *         ],
         *         // Scripts to include in debug contexts
         *         'debugScripts' => [file path string or array of file path strings],
-        *         // For package modules: files to make available for internal require() use
-        *         // 'type' is optional, and will be inferred from the file name extension if omitted
-        *         // 'config' can only be used when 'type' is 'data'; vars are resolved with Config::get()
-        *         // If 'packageFiles' is set, 'scripts' cannot also be set
+        *         // For package modules: files to be made available for internal require() do not
+        *         // need to have 'type' defined; it will be inferred from the file name extension
+        *         // if omitted. 'config' can only be used when 'type' is 'data'; the variables are
+        *         // resolved with Config::get(). The first entry in 'packageFiles' is always the
+        *         // module entry point. If 'packageFiles' is set, 'scripts' cannot also be set.
         *         'packageFiles' => [
         *             [file path string], // or:
         *             [ 'name' => [file name], 'file' => [file path], 'type' => 'script'|'data' ], // or:
@@ -1093,15 +1094,10 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                        if ( is_string( $fileInfo ) ) {
                                $fileInfo = [ 'name' => $fileInfo, 'file' => $fileInfo ];
                        } elseif ( !isset( $fileInfo['name'] ) ) {
-                               // Backwards compatibility
-                               if ( !is_numeric( $alias ) ) {
-                                       $fileInfo['name'] = $alias;
-                               } else {
-                                       $msg = __METHOD__ . ": invalid package file definition for module " .
-                                               "\"{$this->getName()}\": 'name' key is required when value is not a string";
-                                       wfDebugLog( 'resourceloader', $msg );
-                                       throw new MWException( $msg );
-                               }
+                               $msg = __METHOD__ . ": invalid package file definition for module " .
+                                       "\"{$this->getName()}\": 'name' key is required when value is not a string";
+                               wfDebugLog( 'resourceloader', $msg );
+                               throw new MWException( $msg );
                        }
 
                        // Infer type from alias if needed