Passed
Push — master ( f022dc...ec835f )
by Jean-Christophe
02:32
created
Ajax/semantic/html/collections/form/traits/FieldTrait.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,8 +79,9 @@  discard block
 block discarded – undo
79 79
 		$actionO=$action;
80 80
 		if (\is_object($action) === false) {
81 81
 			$actionO=new HtmlButton("action-" . $this->identifier, $action);
82
-			if (isset($icon))
83
-				$actionO->addIcon($icon, true, $labeled);
82
+			if (isset($icon)) {
83
+							$actionO->addIcon($icon, true, $labeled);
84
+			}
84 85
 		}
85 86
 		$field->addToProperty("class", $direction . " action");
86 87
 		$field->addContent($actionO, \strstr($direction, Direction::LEFT) !== false);
@@ -120,8 +121,9 @@  discard block
 block discarded – undo
120 121
 
121 122
 	public function setDisabled($disable=true) {
122 123
 		$field=$this->getField();
123
-		if($disable)
124
-			$field->addToProperty("class", "disabled");
124
+		if($disable) {
125
+					$field->addToProperty("class", "disabled");
126
+		}
125 127
 		return $this;
126 128
 	}
127 129
 	
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FieldsTrait.php 1 patch
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,11 +29,12 @@  discard block
 block discarded – undo
29 29
 		if(\is_array($value)){
30 30
 			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null)));
31 31
 			return $itemO;
32
-		}elseif(\is_object($value)){
32
+		} elseif(\is_object($value)){
33 33
 			$itemO=new HtmlFormField("field-".$this->identifier, $value);
34 34
 			return $itemO;
35
-		}else
36
-			return new HtmlFormInput($value);
35
+		} else {
36
+					return new HtmlFormInput($value);
37
+		}
37 38
 	}
38 39
 
39 40
 	protected function createCondition($value){
@@ -67,8 +68,7 @@  discard block
 block discarded – undo
67 68
 			if(isset($c)){
68 69
 				$df=$c->getDataField();
69 70
 				$df->setProperty($property,$value);
70
-			}
71
-			else{
71
+			} else{
72 72
 				return $this;
73 73
 			}
74 74
 		}
@@ -163,10 +163,12 @@  discard block
 block discarded – undo
163 163
 	public function addButtonIcon($identifier,$icon,$cssStyle=NULL,$onClick=NULL){
164 164
 		$bt=new HtmlButton($identifier);
165 165
 		$bt->asIcon($icon);
166
-		if(isset($onClick))
167
-			$bt->onClick($onClick);
168
-		if (isset($cssStyle))
169
-			$bt->addClass($cssStyle);
166
+		if(isset($onClick)) {
167
+					$bt->onClick($onClick);
168
+		}
169
+		if (isset($cssStyle)) {
170
+					$bt->addClass($cssStyle);
171
+		}
170 172
 		return $this->addItem($bt);
171 173
 	}
172 174
 
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticHtmlCollectionsTrait.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@
 block discarded – undo
35 35
 	 */
36 36
 	public function htmlMessage($identifier, $content="",$styles=NULL) {
37 37
 		$msg= $this->addHtmlComponent(new HtmlMessage($identifier, $content));
38
-		if(isset($msg) && $styles!==null)
39
-			$msg->setStyle($styles);
38
+		if(isset($msg) && $styles!==null) {
39
+					$msg->setStyle($styles);
40
+		}
40 41
 		return $msg;
41 42
 	}
42 43
 
Please login to merge, or discard this patch.
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/HtmlTab.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -82,8 +82,9 @@  discard block
 block discarded – undo
82 82
 			if (isset($this->content[$index]) === false) {
83 83
 				$this->content[$index] = $this->createSegment($index, $content, $menu->getItem($index)
84 84
 					->getIdentifier());
85
-			} else
86
-				$this->content[$index]->setContent($content);
85
+			} else {
86
+							$this->content[$index]->setContent($content);
87
+			}
87 88
 		}
88 89
 		return $this;
89 90
 	}
@@ -277,15 +278,17 @@  discard block
 block discarded – undo
277 278
 	 * @see BaseHtml::run()
278 279
 	 */
279 280
 	public function run(JsUtils $js) {
280
-		if (isset($this->_bsComponent) === false)
281
-			$this->_bsComponent = $js->semantic()->tab("#" . $this->identifier . " .item", $this->params);
281
+		if (isset($this->_bsComponent) === false) {
282
+					$this->_bsComponent = $js->semantic()->tab("#" . $this->identifier . " .item", $this->params);
283
+		}
282 284
 		$this->addEventsOnRun($js);
283 285
 		return $this->_bsComponent;
284 286
 	}
285 287
 
286 288
 	public function compile(JsUtils $js = NULL, &$view = NULL) {
287
-		if (! $this->_activated && $this->content["menu"]->count() > 0 && \sizeof($this->content) > 1)
288
-			$this->activate(0);
289
+		if (! $this->_activated && $this->content["menu"]->count() > 0 && \sizeof($this->content) > 1) {
290
+					$this->activate(0);
291
+		}
289 292
 		return parent::compile($js, $view);
290 293
 	}
291 294
 }
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.