Passed
Push — master ( 90de72...ee7fc7 )
by Jean-Christophe
02:07
created
Ajax/common/traits/JsUtilsAjaxTrait.php 1 patch
Braces   +23 added lines, -16 removed lines patch added patch discarded remove patch
@@ -63,8 +63,9 @@  discard block
 block discarded – undo
63 63
 		$retour .= $this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader, ($historize ? $originalSelector : null)) . "});\n";
64 64
 
65 65
 		$retour = $this->_addJsCondition($jsCondition, $retour);
66
-		if ($immediatly)
67
-			$this->jquery_code_for_compile[] = $retour;
66
+		if ($immediatly) {
67
+					$this->jquery_code_for_compile[] = $retour;
68
+		}
68 69
 		return $retour;
69 70
 	}
70 71
 
@@ -119,8 +120,9 @@  discard block
 block discarded – undo
119 120
 				$retour .= "url=url+'" . $slash . "'+$(this).html();\n";
120 121
 			} elseif (\substr($attr, 0, 3) === "js:") {
121 122
 				$retour .= "url=url+'" . $slash . "'+" . \substr($attr, 3) . ";\n";
122
-			} elseif ($attr !== null && $attr !== "")
123
-				$retour .= "url=url+'" . $slash . "'+($(this).attr('" . $attr . "')||'');\n";
123
+			} elseif ($attr !== null && $attr !== "") {
124
+							$retour .= "url=url+'" . $slash . "'+($(this).attr('" . $attr . "')||'');\n";
125
+			}
124 126
 		}
125 127
 		return $retour;
126 128
 	}
@@ -144,10 +146,11 @@  discard block
 block discarded – undo
144 146
 			} elseif (isset($this->ajaxTransition)) {
145 147
 				$call = $this->ajaxTransition;
146 148
 			}
147
-			if (\is_callable($call))
148
-				$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
149
-			else
150
-				$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
149
+			if (\is_callable($call)) {
150
+							$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
151
+			} else {
152
+							$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
153
+			}
151 154
 		}
152 155
 		if (isset($history)) {
153 156
 			if ($this->params["autoActiveLinks"]) {
@@ -170,8 +173,9 @@  discard block
 block discarded – undo
170 173
 	}
171 174
 
172 175
 	protected function _correctAjaxUrl($url) {
173
-		if ($url !== "/" && JString::endsWith($url, "/") === true)
174
-			$url = substr($url, 0, strlen($url) - 1);
176
+		if ($url !== "/" && JString::endsWith($url, "/") === true) {
177
+					$url = substr($url, 0, strlen($url) - 1);
178
+		}
175 179
 		if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) {
176 180
 			$url = $this->getUrl($url);
177 181
 		}
@@ -195,8 +199,9 @@  discard block
 block discarded – undo
195 199
 	public static function _implodeParams($parameters) {
196 200
 		$allParameters = [];
197 201
 		foreach ($parameters as $params) {
198
-			if (isset($params))
199
-				$allParameters[] = self::_correctParams($params);
202
+			if (isset($params)) {
203
+							$allParameters[] = self::_correctParams($params);
204
+			}
200 205
 		}
201 206
 		return \implode("+'&'+", $allParameters);
202 207
 	}
@@ -222,8 +227,9 @@  discard block
 block discarded – undo
222 227
 
223 228
 	protected function setDefaultParameters(&$parameters, $default) {
224 229
 		foreach ($default as $k => $v) {
225
-			if (! isset($parameters[$k]))
226
-				$parameters[$k] = $v;
230
+			if (! isset($parameters[$k])) {
231
+							$parameters[$k] = $v;
232
+			}
227 233
 		}
228 234
 	}
229 235
 
@@ -755,8 +761,9 @@  discard block
 block discarded – undo
755 761
 			$retour .= "$('#" . $form . "').submit();\n";
756 762
 		}
757 763
 		$retour = $this->_addJsCondition($jsCondition, $retour);
758
-		if ($immediatly)
759
-			$this->jquery_code_for_compile[] = $retour;
764
+		if ($immediatly) {
765
+					$this->jquery_code_for_compile[] = $retour;
766
+		}
760 767
 		return $retour;
761 768
 	}
762 769
 
Please login to merge, or discard this patch.