X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoader.php;h=9764549e84ba529f7a0a71ea1fbe4758f46f0e9f;hp=8f5d083ab5e2d3f865b7f2ec352a8f8ba9249dd9;hb=01cdb1762c7207bd261ad03726a88cb9afc97bfb;hpb=5eff0d6021aa2dc77987ea70ba184446cae08b50 diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 8f5d083ab5..9764549e84 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -1453,24 +1453,19 @@ MESSAGE; * - ResourceLoader::makeLoaderSourcesScript( [ $id1 => $loadUrl, $id2 => $loadUrl, ... ] ); * Register sources with the given IDs and properties. * - * @param string $id Source ID + * @param string|array $sources Source ID * @param string|null $loadUrl load.php url * @return string JavaScript code */ - public static function makeLoaderSourcesScript( $id, $loadUrl = null ) { - if ( is_array( $id ) ) { - return Xml::encodeJsCall( - 'mw.loader.addSource', - [ $id ], - self::inDebugMode() - ); - } else { - return Xml::encodeJsCall( - 'mw.loader.addSource', - [ $id, $loadUrl ], - self::inDebugMode() - ); + public static function makeLoaderSourcesScript( $sources, $loadUrl = null ) { + if ( !is_array( $sources ) ) { + $sources = [ $sources => $loadUrl ]; } + return Xml::encodeJsCall( + 'mw.loader.addSource', + [ $sources ], + self::inDebugMode() + ); } /**