Passed
Push — master ( f2c7af...346e2d )
by Jean-Christophe
02:19
created
Ajax/common/traits/JsUtilsAjaxTrait.php 1 patch
Braces   +20 added lines, -14 removed lines patch added patch discarded remove patch
@@ -73,8 +73,9 @@  discard block
 block discarded – undo
73 73
 		$retour .= $this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader, ($historize ? $originalSelector : null)) . "});\n";
74 74
 
75 75
 		$retour = $this->_addJsCondition($jsCondition, $retour);
76
-		if ($immediatly)
77
-			$this->jquery_code_for_compile[] = $retour;
76
+		if ($immediatly) {
77
+					$this->jquery_code_for_compile[] = $retour;
78
+		}
78 79
 		return $retour;
79 80
 	}
80 81
 
@@ -157,10 +158,11 @@  discard block
 block discarded – undo
157 158
 			} elseif (isset($this->ajaxTransition)) {
158 159
 				$call = $this->ajaxTransition;
159 160
 			}
160
-			if (\is_callable($call))
161
-				$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
162
-			else
163
-				$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
161
+			if (\is_callable($call)) {
162
+							$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
163
+			} else {
164
+							$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
165
+			}
164 166
 		}
165 167
 		if (isset($history)) {
166 168
 			if ($this->params["autoActiveLinks"]) {
@@ -194,8 +196,9 @@  discard block
 block discarded – undo
194 196
 	}
195 197
 
196 198
 	protected function _correctAjaxUrl($url) {
197
-		if ($url !== "/" && JString::endsWith($url, "/") === true)
198
-			$url = substr($url, 0, strlen($url) - 1);
199
+		if ($url !== "/" && JString::endsWith($url, "/") === true) {
200
+					$url = substr($url, 0, strlen($url) - 1);
201
+		}
199 202
 		if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) {
200 203
 			$url = $this->getUrl($url);
201 204
 		}
@@ -219,8 +222,9 @@  discard block
 block discarded – undo
219 222
 	public static function _implodeParams($parameters) {
220 223
 		$allParameters = [];
221 224
 		foreach ($parameters as $params) {
222
-			if (isset($params))
223
-				$allParameters[] = self::_correctParams($params);
225
+			if (isset($params)) {
226
+							$allParameters[] = self::_correctParams($params);
227
+			}
224 228
 		}
225 229
 		return \implode("+'&'+", $allParameters);
226 230
 	}
@@ -254,8 +258,9 @@  discard block
 block discarded – undo
254 258
 
255 259
 	protected function setDefaultParameters(&$parameters, $default) {
256 260
 		foreach ($default as $k => $v) {
257
-			if (! isset($parameters[$k]))
258
-				$parameters[$k] = $v;
261
+			if (! isset($parameters[$k])) {
262
+							$parameters[$k] = $v;
263
+			}
259 264
 		}
260 265
 	}
261 266
 
@@ -820,8 +825,9 @@  discard block
 block discarded – undo
820 825
 			$retour .= "$('#'+" . $form . ").submit();\n";
821 826
 		}
822 827
 		$retour = $this->_addJsCondition($jsCondition, $retour);
823
-		if ($immediatly)
824
-			$this->jquery_code_for_compile[] = $retour;
828
+		if ($immediatly) {
829
+					$this->jquery_code_for_compile[] = $retour;
830
+		}
825 831
 		return $retour;
826 832
 	}
827 833
 
Please login to merge, or discard this patch.