Passed
Push — master ( b53e1e...d0ec95 )
by Jean-Christophe
02:09
created
Ajax/common/traits/JsUtilsInternalTrait.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@  discard block
 block discarded – undo
5 5
 
6 6
 trait JsUtilsInternalTrait {
7 7
 
8
-	protected $jquery_code_for_compile = array();
8
+	protected $jquery_code_for_compile=array();
9 9
 
10
-	protected $jquery_code_for_compile_at_last = array();
10
+	protected $jquery_code_for_compile_at_last=array();
11 11
 
12 12
 	protected function _addToCompile($jsScript) {
13
-		$this->jquery_code_for_compile[] = $jsScript;
13
+		$this->jquery_code_for_compile[]=$jsScript;
14 14
 	}
15 15
 
16 16
 	/**
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @param BaseGui $library
19 19
 	 * @param mixed $view
20 20
 	 */
21
-	protected function _compileLibrary(BaseGui $library, &$view = NULL) {
21
+	protected function _compileLibrary(BaseGui $library, &$view=NULL) {
22 22
 		if (isset($view))
23 23
 			$library->compileHtml($this, $view);
24 24
 		if ($library->isAutoCompile()) {
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 	}
28 28
 
29 29
 	protected function defer($script) {
30
-		$result = "window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { defer(method) }, 50);};";
31
-		$result .= "window.defer(function(){" . $script . "})";
30
+		$result="window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { defer(method) }, 50);};";
31
+		$result.="window.defer(function(){".$script."})";
32 32
 		return $result;
33 33
 	}
34 34
 
35 35
 	protected function ready($script) {
36
-		$result = '$(document).ready(function() {' . "\n";
37
-		$result .= $script . '})';
36
+		$result='$(document).ready(function() {'."\n";
37
+		$result.=$script.'})';
38 38
 		return $result;
39 39
 	}
40 40
 
41 41
 	protected function minify($input) {
42
-		if (trim($input) === "")
42
+		if (trim($input)==="")
43 43
 			return $input;
44
-		$input = preg_replace(array(
44
+		$input=preg_replace(array(
45 45
 			// Remove comment(s)
46 46
 			'#\s*("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')\s*|\s*\/\*(?!\!|@cc_on)(?>[\s\S]*?\*\/)\s*|\s*(?<![\:\=])\/\/.*(?=[\n\r]|$)|^\s*|\s*$#',
47 47
 			// Remove white-space(s) outside the string and regex
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			'$1$3',
60 60
 			'$1.$3'
61 61
 		), $input);
62
-		$input = str_replace("}$", "};$", $input);
62
+		$input=str_replace("}$", "};$", $input);
63 63
 		return $input;
64 64
 	}
65 65
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 * @param string $src
70 70
 	 * @return string
71 71
 	 */
72
-	protected function _open_script($src = '') {
73
-		$str = '<script ';
74
-		$str .= ($src == '') ? '>' : ' src="' . $src . '">';
72
+	protected function _open_script($src='') {
73
+		$str='<script ';
74
+		$str.=($src=='') ? '>' : ' src="'.$src.'">';
75 75
 		return $str;
76 76
 	}
77 77
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @param string $extra
82 82
 	 * @return string
83 83
 	 */
84
-	protected function _close_script($extra = "\n") {
84
+	protected function _close_script($extra="\n") {
85 85
 		return "</script>$extra";
86 86
 	}
87 87
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@  discard block
 block discarded – undo
19 19
 	 * @param mixed $view
20 20
 	 */
21 21
 	protected function _compileLibrary(BaseGui $library, &$view = NULL) {
22
-		if (isset($view))
23
-			$library->compileHtml($this, $view);
22
+		if (isset($view)) {
23
+					$library->compileHtml($this, $view);
24
+		}
24 25
 		if ($library->isAutoCompile()) {
25 26
 			$library->compile(true);
26 27
 		}
@@ -39,8 +40,9 @@  discard block
 block discarded – undo
39 40
 	}
40 41
 
41 42
 	protected function minify($input) {
42
-		if (trim($input) === "")
43
-			return $input;
43
+		if (trim($input) === "") {
44
+					return $input;
45
+		}
44 46
 		$input = preg_replace(array(
45 47
 			// Remove comment(s)
46 48
 			'#\s*("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')\s*|\s*\/\*(?!\!|@cc_on)(?>[\s\S]*?\*\/)\s*|\s*(?<![\:\=])\/\/.*(?=[\n\r]|$)|^\s*|\s*$#',
Please login to merge, or discard this patch.