Passed
Push — master ( fa067a...81b8d1 )
by Jean-Christophe
02:55
created
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.