Passed
Push — master ( c653a4...a7d880 )
by Jean-Christophe
02:17
created
Ajax/common/components/BaseComponent.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 	public function getParam($key) {
41 41
 		$value=null;
42
-		if (array_key_exists($key, $this->params))
43
-			$value=$this->params [$key];
42
+		if (array_key_exists($key, $this->params)) {
43
+					$value=$this->params [$key];
44
+		}
44 45
 		return $value;
45 46
 	}
46 47
 
@@ -49,16 +50,18 @@  discard block
 block discarded – undo
49 50
 	}
50 51
 
51 52
 	public function compile(JsUtils $js=NULL) {
52
-		if ($js==NULL)
53
-			$js=$this->js;
53
+		if ($js==NULL) {
54
+					$js=$this->js;
55
+		}
54 56
 		$script=$this->getScript();
55 57
 		$js->addToCompile($script);
56 58
 	}
57 59
 
58 60
 	protected function setParamCtrl($key, $value, $typeCtrl) {
59 61
 		if (\is_array($typeCtrl)) {
60
-			if (array_search($value, $typeCtrl)===false)
61
-				throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
62
+			if (array_search($value, $typeCtrl)===false) {
63
+							throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
64
+			}
62 65
 		} else {
63 66
 			if (!$typeCtrl($value)) {
64 67
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key);
@@ -70,9 +73,9 @@  discard block
 block discarded – undo
70 73
 	public function setParams($params) {
71 74
 		foreach ( $params as $k => $v ) {
72 75
 			$method="set".ucfirst($k);
73
-			if (method_exists($this, $method))
74
-				$this->$method($v);
75
-			else {
76
+			if (method_exists($this, $method)) {
77
+							$this->$method($v);
78
+			} else {
76 79
 				$this->setParam($k, $v);
77 80
 				trigger_error("`{$k}` doesn't exists!", E_USER_NOTICE);
78 81
 			}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,12 +29,14 @@  discard block
 block discarded – undo
29 29
 				if (\is_string($end)) {
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32
-				} else
33
-					$label=NULL;
32
+				} else {
33
+									$label=NULL;
34
+				}
34 35
 			}
35 36
 		}
36
-		if (isset($label))
37
-			$this->setLabel($label);
37
+		if (isset($label)) {
38
+					$this->setLabel($label);
39
+		}
38 40
 		foreach ( $fields as $field ) {
39 41
 			$this->addItem($field);
40 42
 		}
@@ -57,8 +59,9 @@  discard block
 block discarded – undo
57 59
 
58 60
 	public function addItem($item) {
59 61
 		$item=parent::addItem($item);
60
-		if($item instanceof HtmlFormField)
61
-			$item->setContainer($this);
62
+		if($item instanceof HtmlFormField) {
63
+					$item->setContainer($this);
64
+		}
62 65
 		return $item;
63 66
 	}
64 67
 	
@@ -73,8 +76,9 @@  discard block
 block discarded – undo
73 76
 		if ($this->_equalWidth) {
74 77
 			$count=$this->count();
75 78
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
76
-		} else
77
-			$this->addToProperty("class", "fields");
79
+		} else {
80
+					$this->addToProperty("class", "fields");
81
+		}
78 82
 		return parent::compile($js, $view);
79 83
 	}
80 84
 
@@ -136,8 +140,9 @@  discard block
 block discarded – undo
136 140
 			$fields[]=$itemO;
137 141
 		}
138 142
 		$radios=new HtmlFormFields($identifier, $fields);
139
-		if (isset($label))
140
-			$radios->setLabel($label)->setProperty("for", $name);
143
+		if (isset($label)) {
144
+					$radios->setLabel($label)->setProperty("for", $name);
145
+		}
141 146
 		return $radios;
142 147
 	}
143 148
 
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlEmoji.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -57,20 +57,23 @@
 block discarded – undo
57 57
 	public function asLink($href=NULL,$target=NULL) {
58 58
 		if (isset($href)) {
59 59
 			$_target="";
60
-			if(isset($target))
61
-				$_target="target='{$target}'";
60
+			if(isset($target)) {
61
+							$_target="target='{$target}'";
62
+			}
62 63
 			$this->wrap("<a href='" . $href . "' {$_target}>", "</a>");
63 64
 		}
64 65
 		return $this->addToProperty("class", "link");
65 66
 	}
66 67
 
67 68
 	public function addLabel($label, $before=false, $emoji=null) {
68
-		if($before)
69
-			$this->wrap($label);
70
-		else
71
-			$this->wrap("", $label);
72
-		if($emoji!=null)
73
-			$this->setEmoji($emoji);
69
+		if($before) {
70
+					$this->wrap($label);
71
+		} else {
72
+					$this->wrap("", $label);
73
+		}
74
+		if($emoji!=null) {
75
+					$this->setEmoji($emoji);
76
+		}
74 77
 		return $this;
75 78
 	}
76 79
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlListItem.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,8 +47,9 @@
 block discarded – undo
47 47
 
48 48
 	public function addList($items = array(), $ordered = false) {
49 49
 		$list = new HtmlList("", $items);
50
-		if ($ordered)
51
-			$list->setOrdered();
50
+		if ($ordered) {
51
+					$list->setOrdered();
52
+		}
52 53
 		$list->setClass("list");
53 54
 		$this->content["list"] = $list;
54 55
 		return $list;
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlInput.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
18 18
 	}
19 19
 
20 20
 	public function setValue($value) {
21
-		if (isset($value))
22
-			$this->setProperty("value", $value);
21
+		if (isset($value)) {
22
+					$this->setProperty("value", $value);
23
+		}
23 24
 		return $this;
24 25
 	}
25 26
 
@@ -34,16 +35,18 @@  discard block
 block discarded – undo
34 35
 	}
35 36
 
36 37
 	public function setPlaceholder($value) {
37
-		if (JString::isNotNull($value))
38
-			$this->_placeholder = $value;
38
+		if (JString::isNotNull($value)) {
39
+					$this->_placeholder = $value;
40
+		}
39 41
 		return $this;
40 42
 	}
41 43
 
42 44
 	public function compile(JsUtils $js = NULL, &$view = NULL) {
43 45
 		$value = $this->_placeholder;
44 46
 		if (JString::isNull($value)) {
45
-			if (JString::isNotNull($this->getProperty("name")))
46
-				$value = \ucfirst($this->getProperty("name"));
47
+			if (JString::isNotNull($this->getProperty("name"))) {
48
+							$value = \ucfirst($this->getProperty("name"));
49
+			}
47 50
 		}
48 51
 		$this->setProperty("placeholder", $value);
49 52
 		return parent::compile($js, $view);
Please login to merge, or discard this patch.
Ajax/service/JString.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@
 block discarded – undo
67 67
 	}
68 68
 
69 69
 	public static function doubleBackSlashes($value) {
70
-		if (\is_string($value))
71
-			return \str_replace("\\", "\\\\", $value);
70
+		if (\is_string($value)) {
71
+					return \str_replace("\\", "\\\\", $value);
72
+		}
72 73
 		return $value;
73 74
 	}
74 75
 
Please login to merge, or discard this patch.
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.
Ajax/semantic/html/collections/table/traits/TableTrait.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,10 +24,11 @@  discard block
 block discarded – undo
24 24
 
25 25
 	public function setBasic($very = false) {
26 26
 		$table = $this->_self;
27
-		if ($very)
28
-			$table->addToPropertyCtrl("class", "very", array(
27
+		if ($very) {
28
+					$table->addToPropertyCtrl("class", "very", array(
29 29
 				"very"
30 30
 			));
31
+		}
31 32
 		return $table->addToPropertyCtrl("class", "basic", array(
32 33
 			"basic"
33 34
 		));
@@ -35,10 +36,11 @@  discard block
 block discarded – undo
35 36
 
36 37
 	public function setCompact($very = false) {
37 38
 		$table = $this->_self;
38
-		if ($very)
39
-			$table->addToPropertyCtrl("class", "very", array(
39
+		if ($very) {
40
+					$table->addToPropertyCtrl("class", "very", array(
40 41
 				"very"
41 42
 			));
43
+		}
42 44
 		return $table->addToPropertyCtrl("class", "compact", array(
43 45
 			"compact"
44 46
 		));
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,8 +72,9 @@  discard block
 block discarded – undo
72 72
 
73 73
 	protected function getItemToAdd($item) {
74 74
 		$itemO = parent::getItemToAdd($item);
75
-		if ($itemO instanceof AbstractCheckbox)
76
-			$itemO->addClass("item");
75
+		if ($itemO instanceof AbstractCheckbox) {
76
+					$itemO->addClass("item");
77
+		}
77 78
 		return $itemO;
78 79
 	}
79 80
 
@@ -179,8 +180,9 @@  discard block
 block discarded – undo
179 180
 		if (isset($masterItem)) {
180 181
 			if (\is_array($masterItem)) {
181 182
 				$masterO = new HtmlFormCheckbox("master-" . $identifier, @$masterItem[0], @$masterItem[1]);
182
-				if (isset($name))
183
-					$masterO->setName($name);
183
+				if (isset($name)) {
184
+									$masterO->setName($name);
185
+				}
184 186
 				if (isset($masterItem[1])) {
185 187
 					if (\array_search($masterItem[1], $values) !== false) {
186 188
 						$masterO->getDataField()->setProperty("checked", "");
@@ -204,8 +206,9 @@  discard block
 block discarded – undo
204 206
 			if (\array_search($val, $values) !== false) {
205 207
 				$itemO->getDataField()->setProperty("checked", "");
206 208
 			}
207
-			if (isset($name))
208
-				$itemO->setName($name);
209
+			if (isset($name)) {
210
+							$itemO->setName($name);
211
+			}
209 212
 			$itemO->setClass("item");
210 213
 			$fields[] = $itemO;
211 214
 		}
Please login to merge, or discard this patch.