Passed
Push — master ( 6cf655...807644 )
by Jean-Christophe
02:16
created
Ajax/semantic/html/collections/form/HtmlForm.php 1 patch
Braces   +22 added lines, -15 removed lines patch added patch discarded remove patch
@@ -58,8 +58,9 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public function addHeader($title, $niveau=1, $dividing=true) {
60 60
 		$header=new HtmlHeader("", $niveau, $title);
61
-		if ($dividing)
62
-			$header->setDividing();
61
+		if ($dividing) {
62
+					$header->setDividing();
63
+		}
63 64
 		return $this->addItem($header);
64 65
 	}
65 66
 
@@ -87,8 +88,9 @@  discard block
 block discarded – undo
87 88
 					if (\is_string($end)) {
88 89
 						$label=$end;
89 90
 						\array_pop($fields);
90
-					} else
91
-						$label=NULL;
91
+					} else {
92
+											$label=NULL;
93
+					}
92 94
 				}
93 95
 				$this->_fields=\array_merge($this->_fields, $fields);
94 96
 				$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields);
@@ -152,27 +154,31 @@  discard block
 block discarded – undo
152 154
 	 */
153 155
 	public function addMessage($identifier, $content, $header=NULL, $icon=NULL, $type=NULL) {
154 156
 		$message=new HtmlMessage($identifier, $content);
155
-		if (isset($header))
156
-			$message->addHeader($header);
157
-		if (isset($icon))
158
-			$message->setIcon($icon);
159
-		if (isset($type))
160
-			$message->setStyle($type);
157
+		if (isset($header)) {
158
+					$message->addHeader($header);
159
+		}
160
+		if (isset($icon)) {
161
+					$message->setIcon($icon);
162
+		}
163
+		if (isset($type)) {
164
+					$message->setStyle($type);
165
+		}
161 166
 		return $this->addItem($message);
162 167
 	}
163 168
 
164 169
 
165 170
 
166 171
 	public function compile(JsUtils $js=NULL,&$view=NULL){
167
-		if(\sizeof($this->_validationParams)>0)
168
-			$this->setProperty("novalidate", "");
172
+		if(\sizeof($this->_validationParams)>0) {
173
+					$this->setProperty("novalidate", "");
174
+		}
169 175
 		return parent::compile($js,$view);
170 176
 	}
171 177
 
172 178
 	public function run(JsUtils $js) {
173 179
 		if(isset($js)){
174 180
 			$compo=$js->semantic()->form("#".$this->identifier);
175
-		}else{
181
+		} else{
176 182
 			$compo=new Form();
177 183
 			$compo->attach("#".$this->identifier);
178 184
 		}
@@ -185,8 +191,9 @@  discard block
 block discarded – undo
185 191
 			if($field instanceof HtmlFormFields){
186 192
 				$items=$field->getItems();
187 193
 				foreach ($items as $_field){
188
-					if($_field instanceof HtmlFormField)
189
-						$this->addCompoValidation($compo, $_field);
194
+					if($_field instanceof HtmlFormField) {
195
+											$this->addCompoValidation($compo, $_field);
196
+					}
190 197
 				}
191 198
 			}
192 199
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDropdown.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -141,8 +141,9 @@  discard block
 block discarded – undo
141 141
 	}
142 142
 
143 143
 	public function addInput($name) {
144
-		if (! isset($name))
145
-			$name = "input-" . $this->identifier;
144
+		if (! isset($name)) {
145
+					$name = "input-" . $this->identifier;
146
+		}
146 147
 		$this->setAction("activate");
147 148
 		$this->input = new HtmlInput($name, "hidden");
148 149
 		$this->input->setIdentifier("input-" . $this->identifier);
@@ -293,24 +294,27 @@  discard block
 block discarded – undo
293 294
 
294 295
 	public function asButton($floating = false) {
295 296
 		$this->removeArrow();
296
-		if ($floating)
297
-			$this->addToProperty("class", "floating");
297
+		if ($floating) {
298
+					$this->addToProperty("class", "floating");
299
+		}
298 300
 		$this->removePropertyValue("class", "selection");
299 301
 		return $this->addToProperty("class", "button");
300 302
 	}
301 303
 
302 304
 	public function asSelect($name = NULL, $multiple = false, $selection = true) {
303 305
 		$this->_multiple = $multiple;
304
-		if (isset($name))
305
-			$this->addInput($name);
306
+		if (isset($name)) {
307
+					$this->addInput($name);
308
+		}
306 309
 		if ($multiple) {
307 310
 			$this->addToProperty("class", "multiple");
308 311
 		}
309 312
 		if ($selection) {
310
-			if ($this->propertyContains("class", "button") === false)
311
-				$this->addToPropertyCtrl("class", "selection", array(
313
+			if ($this->propertyContains("class", "button") === false) {
314
+							$this->addToPropertyCtrl("class", "selection", array(
312 315
 					"selection"
313 316
 				));
317
+			}
314 318
 		}
315 319
 		return $this;
316 320
 	}
@@ -322,8 +326,9 @@  discard block
 block discarded – undo
322 326
 
323 327
 	public function setSelect($name = NULL, $multiple = false) {
324 328
 		$this->_template = '<%tagName% id="%identifier%" %properties%>%items%</%tagName%>';
325
-		if (! isset($name))
326
-			$name = "select-" . $this->identifier;
329
+		if (! isset($name)) {
330
+					$name = "select-" . $this->identifier;
331
+		}
327 332
 		$this->input = null;
328 333
 		if ($multiple) {
329 334
 			$this->setProperty("multiple", true);
@@ -368,8 +373,9 @@  discard block
 block discarded – undo
368 373
 			$this->setProperty("value", $value);
369 374
 		}
370 375
 		$textElement = $this->getElementById("text-" . $this->identifier, $this->content);
371
-		if (isset($textElement) && ($textElement instanceof HtmlDoubleElement) && ! $this->_multiple)
372
-			$textElement->setContent($value);
376
+		if (isset($textElement) && ($textElement instanceof HtmlDoubleElement) && ! $this->_multiple) {
377
+					$textElement->setContent($value);
378
+		}
373 379
 		return $this;
374 380
 	}
375 381
 
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDimmer.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@  discard block
 block discarded – undo
26 26
 	public function asIcon($icon, $title, $subHeader = NULL) {
27 27
 		$header = new HtmlHeader("header-" . $this->identifier);
28 28
 		$header->asIcon($icon, $title, $subHeader);
29
-		if ($this->_inverted === false)
30
-			$header->setInverted();
29
+		if ($this->_inverted === false) {
30
+					$header->setInverted();
31
+		}
31 32
 		return $this->setContent($header);
32 33
 	}
33 34
 
@@ -51,8 +52,9 @@  discard block
 block discarded – undo
51 52
 	}
52 53
 
53 54
 	public function jsShow() {
54
-		if (isset($this->_container))
55
-			return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");';
55
+		if (isset($this->_container)) {
56
+					return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");';
57
+		}
56 58
 	}
57 59
 
58 60
 	public function setBlurring() {
Please login to merge, or discard this patch.
Ajax/common/BaseGui.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,8 +45,9 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	public function compile($internal = false) {
48
-		if ($internal === false && $this->autoCompile === true)
49
-			throw new \Exception("Impossible to compile if autoCompile is set to 'true'");
48
+		if ($internal === false && $this->autoCompile === true) {
49
+					throw new \Exception("Impossible to compile if autoCompile is set to 'true'");
50
+		}
50 51
 		foreach ($this->components as $component) {
51 52
 			$component->compile();
52 53
 		}
@@ -69,9 +70,10 @@  discard block
 block discarded – undo
69 70
 				$this->components[] = $component;
70 71
 			}
71 72
 		}
72
-		if (isset($params))
73
-			if (\is_array($params))
73
+		if (isset($params)) {
74
+					if (\is_array($params))
74 75
 				$component->setParams($params);
76
+		}
75 77
 		return $component;
76 78
 	}
77 79
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlMessage.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -85,10 +85,11 @@  discard block
 block discarded – undo
85 85
 	}
86 86
 
87 87
 	public function setDismissable($dismiss = true) {
88
-		if ($dismiss === true)
89
-			$this->close = new HtmlIcon("close-" . $this->identifier, "close");
90
-		else
91
-			$this->close = NULL;
88
+		if ($dismiss === true) {
89
+					$this->close = new HtmlIcon("close-" . $this->identifier, "close");
90
+		} else {
91
+					$this->close = NULL;
92
+		}
92 93
 		return $this;
93 94
 	}
94 95
 
@@ -139,7 +140,8 @@  discard block
 block discarded – undo
139 140
 	public function setMessage($message) {
140 141
 		if (\is_array($this->content)) {
141 142
 			$this->content[\sizeof($this->content) - 1] = $message;
142
-		} else
143
-			$this->setContent($message);
143
+		} else {
144
+					$this->setContent($message);
145
+		}
144 146
 	}
145 147
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/checkbox/AbstractCheckbox.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
 		$field = new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value);
16 16
 		$field->setProperty("name", $name);
17 17
 		$this->setField($field);
18
-		if (isset($label))
19
-			$this->setLabel($label, $value);
18
+		if (isset($label)) {
19
+					$this->setLabel($label, $value);
20
+		}
20 21
 		$this->setLibraryId($identifier);
21 22
 	}
22 23
 
@@ -40,8 +41,9 @@  discard block
 block discarded – undo
40 41
 			$labelO->setContent($label);
41 42
 			$labelO->setProperty("for", $this->getField()
42 43
 				->getIdentifier());
43
-			if (isset($value))
44
-				$labelO->setProperty("data-value", $value);
44
+			if (isset($value)) {
45
+							$labelO->setProperty("data-value", $value);
46
+			}
45 47
 		}
46 48
 		$this->content["label"] = $labelO;
47 49
 	}
@@ -56,8 +58,9 @@  discard block
 block discarded – undo
56 58
 	 * @return mixed
57 59
 	 */
58 60
 	public function getLabel() {
59
-		if (\array_key_exists("label", $this->content))
60
-			return $this->content["label"];
61
+		if (\array_key_exists("label", $this->content)) {
62
+					return $this->content["label"];
63
+		}
61 64
 	}
62 65
 
63 66
 	/**
@@ -138,8 +141,9 @@  discard block
 block discarded – undo
138 141
 	}
139 142
 
140 143
 	public function run(JsUtils $js) {
141
-		if (! isset($this->_bsComponent))
142
-			$this->_bsComponent = $js->semantic()->checkbox("#" . $this->identifier, $this->_params);
144
+		if (! isset($this->_bsComponent)) {
145
+					$this->_bsComponent = $js->semantic()->checkbox("#" . $this->identifier, $this->_params);
146
+		}
143 147
 		return parent::run($js);
144 148
 	}
145 149
 }
Please login to merge, or discard this patch.
Ajax/service/JArray.php 1 patch
Braces   +15 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,21 +12,24 @@  discard block
 block discarded – undo
12 12
 			return $array[$key];
13 13
 		}
14 14
 		$values = array_values($array);
15
-		if ($pos < sizeof($values))
16
-			return $values[$pos];
15
+		if ($pos < sizeof($values)) {
16
+					return $values[$pos];
17
+		}
17 18
 	}
18 19
 
19 20
 	public static function getConditionalValue($array, $key, $condition) {
20 21
 		$result = NULL;
21 22
 		if (array_key_exists($key, $array)) {
22 23
 			$result = $array[$key];
23
-			if ($condition($result) === true)
24
-				return $result;
24
+			if ($condition($result) === true) {
25
+							return $result;
26
+			}
25 27
 		}
26 28
 		$values = array_values($array);
27 29
 		foreach ($values as $val) {
28
-			if ($condition($val) === true)
29
-				return $val;
30
+			if ($condition($val) === true) {
31
+							return $val;
32
+			}
30 33
 		}
31 34
 		return $result;
32 35
 	}
@@ -34,8 +37,9 @@  discard block
 block discarded – undo
34 37
 	public static function getDefaultValue($array, $key, $default = NULL) {
35 38
 		if (array_key_exists($key, $array)) {
36 39
 			return $array[$key];
37
-		} else
38
-			return $default;
40
+		} else {
41
+					return $default;
42
+		}
39 43
 	}
40 44
 
41 45
 	public static function implode($glue, $pieces) {
@@ -116,12 +120,12 @@  discard block
 block discarded – undo
116 120
 	}
117 121
 
118 122
 	private static function callFunction($object, $callback) {
119
-		if (\is_string($callback))
120
-			return \call_user_func(array(
123
+		if (\is_string($callback)) {
124
+					return \call_user_func(array(
121 125
 				$object,
122 126
 				$callback
123 127
 			), []);
124
-		else if (\is_callable($callback)) {
128
+		} else if (\is_callable($callback)) {
125 129
 			return $callback($object);
126 130
 		}
127 131
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButton.php 1 patch
Braces   +18 added lines, -13 removed lines patch added patch discarded remove patch
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
 	}
72 72
 
73 73
 	public function setFocusable($value = true) {
74
-		if ($value === true)
75
-			$this->setProperty("tabindex", "0");
76
-		else {
74
+		if ($value === true) {
75
+					$this->setProperty("tabindex", "0");
76
+		} else {
77 77
 			$this->removeProperty("tabindex");
78 78
 		}
79 79
 		return $this;
@@ -126,8 +126,9 @@  discard block
 block discarded – undo
126 126
 	public function addLabel($label, $before = false, $icon = NULL) {
127 127
 		$this->tagName = "div";
128 128
 		$prefix = "";
129
-		if ($before)
130
-			$prefix = "left ";
129
+		if ($before) {
130
+					$prefix = "left ";
131
+		}
131 132
 		$this->addToProperty("class", $prefix . "labeled");
132 133
 		$isIcon = (isset($this->content[0]) && $this->content[0] instanceof HtmlIcon);
133 134
 		$this->content = new HtmlButton("button-" . $this->identifier, $this->content);
@@ -165,11 +166,13 @@  discard block
 block discarded – undo
165 166
 	public function setColor($color) {
166 167
 		if (\is_array($this->content)) {
167 168
 			foreach ($this->content as $content) {
168
-				if ($content instanceof HtmlButton)
169
-					$content->setColor($color);
169
+				if ($content instanceof HtmlButton) {
170
+									$content->setColor($color);
171
+				}
170 172
 			}
171
-		} else
172
-			parent::setColor($color);
173
+		} else {
174
+					parent::setColor($color);
175
+		}
173 176
 		return $this;
174 177
 	}
175 178
 
@@ -226,8 +229,9 @@  discard block
 block discarded – undo
226 229
 	 * @return HtmlButton
227 230
 	 */
228 231
 	public static function social($identifier, $social, $value = NULL) {
229
-		if ($value === NULL)
230
-			$value = \ucfirst($social);
232
+		if ($value === NULL) {
233
+					$value = \ucfirst($social);
234
+		}
231 235
 		$return = new HtmlButton($identifier, $value);
232 236
 		$return->addIcon($social);
233 237
 		return $return->addToPropertyCtrl("class", $social, Social::getConstants());
@@ -286,8 +290,9 @@  discard block
 block discarded – undo
286 290
 			$value
287 291
 		]);
288 292
 		$dd = $result->addDropdown($items, $asCombo);
289
-		if (isset($icon) && $dd instanceof HtmlDropdown)
290
-			$dd->setIcon($icon);
293
+		if (isset($icon) && $dd instanceof HtmlDropdown) {
294
+					$dd->setIcon($icon);
295
+		}
291 296
 		return $result;
292 297
 	}
293 298
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Braces   +23 added lines, -18 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	private function afterInsert($item) {
65
-		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false)
66
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
67
-		else {
65
+		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) {
66
+					$item->addToPropertyCtrl("class", "item", array ("item" ));
67
+		} else {
68 68
 			$this->setSecondary();
69 69
 		}
70 70
 		return $item;
@@ -79,8 +79,9 @@  discard block
 block discarded – undo
79 79
 	public function addItem($item) {
80 80
 		$number=$item;
81 81
 		$item=parent::addItem($this->getItemToInsert($item));
82
-		if(\is_int($number))
83
-			$item->setProperty("data-page", $number);
82
+		if(\is_int($number)) {
83
+					$item->setProperty("data-page", $number);
84
+		}
84 85
 		return $this->afterInsert($item);
85 86
 	}
86 87
 
@@ -121,7 +122,7 @@  discard block
 block discarded – undo
121 122
 		if(!($caption instanceof HtmlDoubleElement)){
122 123
 			$header=new HtmlDoubleElement('','div');
123 124
 			$header->setContent($caption);
124
-		}else{
125
+		} else{
125 126
 			$header=$caption;
126 127
 		}
127 128
 		$header->addClass('item header');
@@ -166,10 +167,11 @@  discard block
 block discarded – undo
166 167
 	}
167 168
 
168 169
 	public function setSecondary($value=true) {
169
-		if($value)
170
-			$this->addToProperty("class", "secondary");
171
-		else
172
-			$this->removePropertyValue("class", "secondary");
170
+		if($value) {
171
+					$this->addToProperty("class", "secondary");
172
+		} else {
173
+					$this->removePropertyValue("class", "secondary");
174
+		}
173 175
 		return $this;
174 176
 	}
175 177
 
@@ -189,8 +191,9 @@  discard block
 block discarded – undo
189 191
 		$this->apply(function (HtmlDoubleElement &$item) {
190 192
 			$item->setTagName("a");
191 193
 		});
192
-		if ($vertical === true)
193
-			$this->setVertical();
194
+		if ($vertical === true) {
195
+					$this->setVertical();
196
+		}
194 197
 		return $this->addToProperty("class", "tabular");
195 198
 	}
196 199
 
@@ -219,10 +222,11 @@  discard block
 block discarded – undo
219 222
 	 */
220 223
 	public function fromDatabaseObject($object, $function) {
221 224
 		$return=$function($object);
222
-		if (\is_array($return))
223
-			$this->addItems($return);
224
-		else
225
-			$this->addItem($return);
225
+		if (\is_array($return)) {
226
+					$this->addItems($return);
227
+		} else {
228
+					$this->addItem($return);
229
+		}
226 230
 	}
227 231
 
228 232
 	/**
@@ -255,8 +259,9 @@  discard block
 block discarded – undo
255 259
 	}
256 260
 
257 261
 	public function run(JsUtils $js){
258
-		if($this->identifier!=="" && !isset($this->_bsComponent))
259
-			$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
262
+		if($this->identifier!=="" && !isset($this->_bsComponent)) {
263
+					$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
264
+		}
260 265
 		$result= parent::run($js);
261 266
 		return $result->setItemSelector(">.item:not(.header)");
262 267
 	}
Please login to merge, or discard this patch.