Passed
Push — master ( a67f6b...254bb0 )
by Jean-Christophe
02:30
created
Ajax/common/traits/JsUtilsAjaxTrait.php 1 patch
Braces   +20 added lines, -14 removed lines patch added patch discarded remove patch
@@ -71,8 +71,9 @@  discard block
 block discarded – undo
71 71
 		$retour .= $this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader, ($historize ? $originalSelector : null)) . "});\n";
72 72
 
73 73
 		$retour = $this->_addJsCondition($jsCondition, $retour);
74
-		if ($immediatly)
75
-			$this->jquery_code_for_compile[] = $retour;
74
+		if ($immediatly) {
75
+					$this->jquery_code_for_compile[] = $retour;
76
+		}
76 77
 		return $retour;
77 78
 	}
78 79
 
@@ -155,10 +156,11 @@  discard block
 block discarded – undo
155 156
 			} elseif (isset($this->ajaxTransition)) {
156 157
 				$call = $this->ajaxTransition;
157 158
 			}
158
-			if (\is_callable($call))
159
-				$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
160
-			else
161
-				$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
159
+			if (\is_callable($call)) {
160
+							$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
161
+			} else {
162
+							$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
163
+			}
162 164
 		}
163 165
 		if (isset($history)) {
164 166
 			if ($this->params["autoActiveLinks"]) {
@@ -183,8 +185,9 @@  discard block
 block discarded – undo
183 185
 	}
184 186
 
185 187
 	protected function _correctAjaxUrl($url) {
186
-		if ($url !== "/" && JString::endsWith($url, "/") === true)
187
-			$url = substr($url, 0, strlen($url) - 1);
188
+		if ($url !== "/" && JString::endsWith($url, "/") === true) {
189
+					$url = substr($url, 0, strlen($url) - 1);
190
+		}
188 191
 		if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) {
189 192
 			$url = $this->getUrl($url);
190 193
 		}
@@ -208,8 +211,9 @@  discard block
 block discarded – undo
208 211
 	public static function _implodeParams($parameters) {
209 212
 		$allParameters = [];
210 213
 		foreach ($parameters as $params) {
211
-			if (isset($params))
212
-				$allParameters[] = self::_correctParams($params);
214
+			if (isset($params)) {
215
+							$allParameters[] = self::_correctParams($params);
216
+			}
213 217
 		}
214 218
 		return \implode("+'&'+", $allParameters);
215 219
 	}
@@ -243,8 +247,9 @@  discard block
 block discarded – undo
243 247
 
244 248
 	protected function setDefaultParameters(&$parameters, $default) {
245 249
 		foreach ($default as $k => $v) {
246
-			if (! isset($parameters[$k]))
247
-				$parameters[$k] = $v;
250
+			if (! isset($parameters[$k])) {
251
+							$parameters[$k] = $v;
252
+			}
248 253
 		}
249 254
 	}
250 255
 
@@ -775,8 +780,9 @@  discard block
 block discarded – undo
775 780
 			$retour .= "$('#" . $form . "').submit();\n";
776 781
 		}
777 782
 		$retour = $this->_addJsCondition($jsCondition, $retour);
778
-		if ($immediatly)
779
-			$this->jquery_code_for_compile[] = $retour;
783
+		if ($immediatly) {
784
+					$this->jquery_code_for_compile[] = $retour;
785
+		}
780 786
 		return $retour;
781 787
 	}
782 788
 
Please login to merge, or discard this patch.