From 0d05cd72983ab3e0c9472929915eff16cb8009ac Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 2 May 2016 23:25:49 +0200 Subject: * JS compression factored out to separate method --- app/php/web/ClientScriptManager.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/php/web/ClientScriptManager.php b/app/php/web/ClientScriptManager.php index 1a73b3e..0dbdffa 100644 --- a/app/php/web/ClientScriptManager.php +++ b/app/php/web/ClientScriptManager.php @@ -137,6 +137,12 @@ class ClientScriptManager extends TClientScriptManager { ); } + private function _getCompressedScript($path) { + return trim(TJavaScript::JSMin( + file_get_contents($path) + )); + } + private function _compileScriptFiles($files) { foreach ($files as $file) { $this->markScriptFileAsRendered($file); @@ -151,13 +157,7 @@ class ClientScriptManager extends TClientScriptManager { $scriptContent = implode( PHP_EOL, array_map( - function($path) { - return trim( - TJavaScript::JSMin( - file_get_contents($path) - ) - ); - }, + [$this, '_getCompressedScript'], $paths ) ); -- cgit v1.2.3