From 46b369894742d3bb63afc54ca8f4bc9686ce72de Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Sat, 4 Oct 2014 17:02:55 +0300 Subject: [PATCH] Avoid extra-long code lines Makes phpcs happy. Change-Id: Ideb4d4e7b9f5c385f108b91b26a796ecf6833d47 --- .../resourceloader/ResourceLoaderStartUpModule.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 2f3d3f8975..ee662888f9 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -387,11 +387,20 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { $registrations = $this->getModuleRegistrations( $context ); // Fix indentation $registrations = str_replace( "\n", "\n\t", trim( $registrations ) ); + $mwMapJsCall = Xml::encodeJsCall( + 'mw.Map', + array( $this->getConfig()->get( 'LegacyJavaScriptGlobals' ) ) + ); + $mwConfigSetJsCall = Xml::encodeJsCall( + 'mw.config.set', + array( $configuration ) + ); + $out .= "var startUp = function () {\n" . "\tmw.config = new " . - Xml::encodeJsCall( 'mw.Map', array( $this->getConfig()->get( 'LegacyJavaScriptGlobals' ) ) ) . "\n" . + $mwMapJsCall . "\n" . "\t$registrations\n" . - "\t" . Xml::encodeJsCall( 'mw.config.set', array( $configuration ) ) . + "\t" . $mwConfigSetJsCall . "};\n"; // Conditional script injection -- 2.20.1