From: jenkins-bot Date: Mon, 17 Sep 2018 18:44:42 +0000 (+0000) Subject: Merge "resourceloader: Remove unused makeCustomLoaderScript() method" X-Git-Tag: 1.34.0-rc.0~4077 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=42310ac502e3570d565288efd163d087113853e9;hp=-c Merge "resourceloader: Remove unused makeCustomLoaderScript() method" --- 42310ac502e3570d565288efd163d087113853e9 diff --combined includes/resourceloader/ResourceLoader.php index de26a9225b,0d9eade991..dde72b2f36 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@@ -1223,7 -1223,7 +1223,7 @@@ MESSAGE if ( self::inDebugMode() ) { $scripts = new XmlJsCode( "function ( $, jQuery, require, module ) {\n{$scripts->value}\n}" ); } else { - $scripts = new XmlJsCode( 'function($,jQuery,require,module){'. $scripts->value . '}' ); + $scripts = new XmlJsCode( 'function($,jQuery,require,module){' . $scripts->value . '}' ); } } elseif ( !is_string( $scripts ) && !is_array( $scripts ) ) { throw new MWException( 'Invalid scripts error. Array of URLs or string of code expected.' ); @@@ -1317,31 -1317,6 +1317,6 @@@ ); } - /** - * Returns JS code which calls the script given by $script. The script will - * be called with local variables name, version, dependencies and group, - * which will have values corresponding to $name, $version, $dependencies - * and $group as supplied. - * - * @param string $name Module name - * @param string $version Module version hash - * @param array $dependencies List of module names on which this module depends - * @param string $group Group which the module is in. - * @param string $source Source of the module, or 'local' if not foreign. - * @param string $script JavaScript code - * @return string JavaScript code - */ - public static function makeCustomLoaderScript( $name, $version, $dependencies, - $group, $source, $script - ) { - $script = str_replace( "\n", "\n\t", trim( $script ) ); - return Xml::encodeJsCall( - "( function ( name, version, dependencies, group, source ) {\n\t$script\n} )", - [ $name, $version, $dependencies, $group, $source ], - self::inDebugMode() - ); - } - private static function isEmptyObject( stdClass $obj ) { foreach ( $obj as $key => $value ) { return false;