Passed
Push — master ( 4fc601...e10dfd )
by Jean-Christophe
02:05
created
Ajax/common/traits/JsUtilsActionsTrait.php 1 patch
Braces   +36 added lines, -24 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 			$callback = ", function(){\n{$callback}\n}";
35 35
 		}
36 36
 		$str = "$({$element}).{$action}({$speed}{$callback});";
37
-		if ($immediatly)
38
-			$this->jquery_code_for_compile[] = $str;
37
+		if ($immediatly) {
38
+					$this->jquery_code_for_compile[] = $str;
39
+		}
39 40
 		return $str;
40 41
 	}
41 42
 
@@ -73,10 +74,12 @@  discard block
 block discarded – undo
73 74
 		if (isset($param)) {
74 75
 			$param = Javascript::prep_value($param);
75 76
 			$str = "$({$element}).{$jQueryCall}({$param});";
76
-		} else
77
-			$str = "$({$element}).{$jQueryCall}();";
78
-		if ($immediatly)
79
-			$this->jquery_code_for_compile[] = $str;
77
+		} else {
78
+					$str = "$({$element}).{$jQueryCall}();";
79
+		}
80
+		if ($immediatly) {
81
+					$this->jquery_code_for_compile[] = $str;
82
+		}
80 83
 		return $str;
81 84
 	}
82 85
 
@@ -94,8 +97,9 @@  discard block
 block discarded – undo
94 97
 		$to = Javascript::prep_element($to);
95 98
 		$element = Javascript::prep_element($element);
96 99
 		$str = "$({$to}).{$jQueryCall}({$element});";
97
-		if ($immediatly)
98
-			$this->jquery_code_for_compile[] = $str;
100
+		if ($immediatly) {
101
+					$this->jquery_code_for_compile[] = $str;
102
+		}
99 103
 		return $str;
100 104
 	}
101 105
 
@@ -153,10 +157,12 @@  discard block
 block discarded – undo
153 157
 		if (isset($value)) {
154 158
 			$value = Javascript::prep_value($value);
155 159
 			$str = "$({$element}).attr(\"$attributeName\",{$value});";
156
-		} else
157
-			$str = "$({$element}).attr(\"$attributeName\");";
158
-		if ($immediatly)
159
-			$this->jquery_code_for_compile[] = $str;
160
+		} else {
161
+					$str = "$({$element}).attr(\"$attributeName\");";
162
+		}
163
+		if ($immediatly) {
164
+					$this->jquery_code_for_compile[] = $str;
165
+		}
160 166
 		return $str;
161 167
 	}
162 168
 
@@ -219,8 +225,9 @@  discard block
 block discarded – undo
219 225
 
220 226
 		$str = "$({$element}).animate({\n$animations\n\t\t}" . $speed . $extra . ");";
221 227
 
222
-		if ($immediatly)
223
-			$this->jquery_code_for_compile[] = $str;
228
+		if ($immediatly) {
229
+					$this->jquery_code_for_compile[] = $str;
230
+		}
224 231
 		return $str;
225 232
 	}
226 233
 
@@ -410,8 +417,9 @@  discard block
 block discarded – undo
410 417
 		$element = Javascript::prep_element($element);
411 418
 		$str = "$({$element}).trigger(\"$event\");";
412 419
 
413
-		if ($immediatly)
414
-			$this->jquery_code_for_compile[] = $str;
420
+		if ($immediatly) {
421
+					$this->jquery_code_for_compile[] = $str;
422
+		}
415 423
 		return $str;
416 424
 	}
417 425
 
@@ -481,8 +489,9 @@  discard block
 block discarded – undo
481 489
 			$str .= "else{" . $jsCodeIfFalse . "}";
482 490
 		}
483 491
 
484
-		if ($immediatly)
485
-			$this->jquery_code_for_compile[] = $str;
492
+		if ($immediatly) {
493
+					$this->jquery_code_for_compile[] = $str;
494
+		}
486 495
 		return $str;
487 496
 	}
488 497
 
@@ -500,11 +509,13 @@  discard block
 block discarded – undo
500 509
 	private function _doJQuery($element, $jqueryCall, $param = "", $jsCallback = "", $immediatly = false) {
501 510
 		$param = Javascript::prep_value($param);
502 511
 		$callback = "";
503
-		if ($jsCallback != "")
504
-			$callback = ", function(event){\n{$jsCallback}\n}";
512
+		if ($jsCallback != "") {
513
+					$callback = ", function(event){\n{$jsCallback}\n}";
514
+		}
505 515
 		$script = "$(" . Javascript::prep_element($element) . ")." . $jqueryCall . "(" . $param . $callback . ");\n";
506
-		if ($immediatly)
507
-			$this->jquery_code_for_compile[] = $script;
516
+		if ($immediatly) {
517
+					$this->jquery_code_for_compile[] = $script;
518
+		}
508 519
 		return $script;
509 520
 	}
510 521
 
@@ -591,8 +602,9 @@  discard block
 block discarded – undo
591 602
 	 */
592 603
 	public function exec($js, $immediatly = false) {
593 604
 		$script = $js . "\n";
594
-		if ($immediatly)
595
-			$this->jquery_code_for_compile[] = $script;
605
+		if ($immediatly) {
606
+					$this->jquery_code_for_compile[] = $script;
607
+		}
596 608
 		return $script;
597 609
 	}
598 610
 
Please login to merge, or discard this patch.