From: Fomafix Date: Mon, 5 Aug 2019 18:59:08 +0000 (+0200) Subject: ResourceLoaderClientHtml: Simplify code X-Git-Tag: 1.34.0-rc.0~777^2 X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=7a208445637d20681d5d262610958249e144577a ResourceLoaderClientHtml: Simplify code * Use nowdoc instead of heredoc syntax where variable expansion is not wanted. * Combine code paths for debug mode and normal mode. Change-Id: Ic70d82aaec6396a31783e5a60419409f08c4ef73 --- diff --git a/includes/resourceloader/ResourceLoaderClientHtml.php b/includes/resourceloader/ResourceLoaderClientHtml.php index e324d04423..d59e1c8c9a 100644 --- a/includes/resourceloader/ResourceLoaderClientHtml.php +++ b/includes/resourceloader/ResourceLoaderClientHtml.php @@ -235,7 +235,7 @@ class ResourceLoaderClientHtml { // Change "client-nojs" class to client-js. This allows easy toggling of UI components. // This must happen synchronously on every page view to avoid flashes of wrong content. // See also #getDocumentAttributes() and /resources/src/startup.js. - $script = <<context->getDebug() ) { - $chunks[] = Html::inlineScript( $script, $nonce ); - } else { - $chunks[] = Html::inlineScript( - ResourceLoader::filter( 'minify-js', $script, [ 'cache' => false ] ), - $nonce - ); + if ( !$this->context->getDebug() ) { + $script = ResourceLoader::filter( 'minify-js', $script, [ 'cache' => false ] ); } + $chunks[] = Html::inlineScript( $script, $nonce ); + // Inline RLQ: Embedded modules if ( $data['embed']['general'] ) { $chunks[] = $this->getLoad(