Completed
Push — master ( 735cac...641d44 )
by Jean-Christophe
04:20
created
Ajax/semantic/html/elements/HtmlInput.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 		$labelO=$label;
34 34
 		if (\is_object($label)===false) {
35 35
 			$labelO=new HtmlLabel("label-".$this->identifier, $label);
36
-			if (isset($icon))
37
-				$labelO->addIcon($icon);
36
+			if (isset($icon)) {
37
+							$labelO->addIcon($icon);
38
+			}
38 39
 		} else {
39 40
 			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
40 41
 		}
@@ -51,8 +52,9 @@  discard block
 block discarded – undo
51 52
 		$actionO=$action;
52 53
 		if (\is_object($action)===false) {
53 54
 			$actionO=new HtmlButton("action-".$this->identifier, $action);
54
-			if (isset($icon))
55
-				$actionO->addIcon($icon, true, $labeled);
55
+			if (isset($icon)) {
56
+							$actionO->addIcon($icon, true, $labeled);
57
+			}
56 58
 		}
57 59
 		$this->addToProperty("class", $direction." action");
58 60
 		$this->addContent($actionO, \strstr($direction, Direction::LEFT)!==false);
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@
 block discarded – undo
21 21
 		if (\is_array($value)) {
22 22
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
23 23
 			$item->addIcon($value[1]);
24
-		} else
25
-			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
24
+		} else {
25
+					$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
26
+		}
26 27
 		return $item;
27 28
 	}
28 29
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	private function afterInsert($item) {
58
-		if (!$item instanceof HtmlMenu)
59
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
60
-		else {
58
+		if (!$item instanceof HtmlMenu) {
59
+					$item->addToPropertyCtrl("class", "item", array ("item" ));
60
+		} else {
61 61
 			$this->setSecondary();
62 62
 		}
63 63
 		return $item;
@@ -155,8 +155,9 @@  discard block
 block discarded – undo
155 155
 		$this->apply(function (HtmlDoubleElement &$item) {
156 156
 			$item->setTagName("a");
157 157
 		});
158
-		if ($vertical === true)
159
-			$this->setVertical();
158
+		if ($vertical === true) {
159
+					$this->setVertical();
160
+		}
160 161
 		return $this->addToProperty("class", "tabular");
161 162
 	}
162 163
 
@@ -185,10 +186,11 @@  discard block
 block discarded – undo
185 186
 	 */
186 187
 	public function fromDatabaseObject($object, $function) {
187 188
 		$return=$function($object);
188
-		if (\is_array($return))
189
-			$this->addItems($return);
190
-		else
191
-			$this->addItem($return);
189
+		if (\is_array($return)) {
190
+					$this->addItems($return);
191
+		} else {
192
+					$this->addItem($return);
193
+		}
192 194
 	}
193 195
 
194 196
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButton.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 	}
55 55
 
56 56
 	public function setFocusable($value=true) {
57
-		if ($value === true)
58
-			$this->setProperty("tabindex", "0");
59
-		else {
57
+		if ($value === true) {
58
+					$this->setProperty("tabindex", "0");
59
+		} else {
60 60
 			$this->removeProperty("tabindex");
61 61
 		}
62 62
 		return $this;
@@ -181,8 +181,9 @@  discard block
 block discarded – undo
181 181
 	}
182 182
 
183 183
 	public static function social($identifier, $social, $value=NULL) {
184
-		if ($value === NULL)
185
-			$value=\ucfirst($social);
184
+		if ($value === NULL) {
185
+					$value=\ucfirst($social);
186
+		}
186 187
 		$return=new HtmlButton($identifier, $value);
187 188
 		$return->addIcon($social);
188 189
 		return $return->addToPropertyCtrl("class", $social, Social::getConstants());
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridCol.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@
 block discarded – undo
19 19
 	public function __construct($identifier, $width=NULL) {
20 20
 		parent::__construct($identifier, "div");
21 21
 		$this->setClass("column");
22
-		if (isset($width))
23
-			$this->setWidth($width);
22
+		if (isset($width)) {
23
+					$this->setWidth($width);
24
+		}
24 25
 	}
25 26
 
26 27
 	/**
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -51,17 +51,19 @@  discard block
 block discarded – undo
51 51
 	}
52 52
 
53 53
 	public function getProperty($name) {
54
-		if (array_key_exists($name, $this->properties))
55
-			return $this->properties[$name];
54
+		if (array_key_exists($name, $this->properties)) {
55
+					return $this->properties[$name];
56
+		}
56 57
 	}
57 58
 
58 59
 	public function addToProperty($name, $value, $separator=" ") {
59 60
 		if ($value !== "" && $this->propertyContains($name, $value) === false) {
60 61
 			$v=@$this->properties[$name];
61
-			if (isset($v) && $v !== "")
62
-				$v=$v . $separator . $value;
63
-			else
64
-				$v=$value;
62
+			if (isset($v) && $v !== "") {
63
+							$v=$v . $separator . $value;
64
+			} else {
65
+							$v=$value;
66
+			}
65 67
 			
66 68
 			return $this->setProperty($name, $v);
67 69
 		}
@@ -121,8 +123,9 @@  discard block
 block discarded – undo
121 123
 	}
122 124
 
123 125
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
124
-		if ($this->ctrl($name, $value, $typeCtrl) === true)
125
-			return $this->setProperty($name, $value);
126
+		if ($this->ctrl($name, $value, $typeCtrl) === true) {
127
+					return $this->setProperty($name, $value);
128
+		}
126 129
 		return $this;
127 130
 	}
128 131
 
@@ -152,8 +155,9 @@  discard block
 block discarded – undo
152 155
 	}
153 156
 
154 157
 	protected function removeProperty($name) {
155
-		if (\array_key_exists($name, $this->properties))
156
-			unset($this->properties[$name]);
158
+		if (\array_key_exists($name, $this->properties)) {
159
+					unset($this->properties[$name]);
160
+		}
157 161
 		return $this;
158 162
 	}
159 163
 
@@ -173,8 +177,9 @@  discard block
 block discarded – undo
173 177
 	}
174 178
 
175 179
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
176
-		if (@class_exists($typeCtrl, true))
177
-			$typeCtrl=$typeCtrl::getConstants();
180
+		if (@class_exists($typeCtrl, true)) {
181
+					$typeCtrl=$typeCtrl::getConstants();
182
+		}
178 183
 		if (is_array($typeCtrl)) {
179 184
 			$this->removeOldValues($this->properties[$name], $typeCtrl);
180 185
 		}
@@ -359,15 +364,18 @@  discard block
 block discarded – undo
359 364
 			$flag=false;
360 365
 			$index=0;
361 366
 			while ( !$flag && $index < sizeof($elements) ) {
362
-				if ($elements[$index] instanceof BaseHtml)
363
-					$flag=($elements[$index]->getIdentifier() === $identifier);
367
+				if ($elements[$index] instanceof BaseHtml) {
368
+									$flag=($elements[$index]->getIdentifier() === $identifier);
369
+				}
364 370
 				$index++;
365 371
 			}
366
-			if ($flag === true)
367
-				return $elements[$index - 1];
372
+			if ($flag === true) {
373
+							return $elements[$index - 1];
374
+			}
368 375
 		} elseif ($elements instanceof BaseHtml) {
369
-			if ($elements->getIdentifier() === $identifier)
370
-				return $elements;
376
+			if ($elements->getIdentifier() === $identifier) {
377
+							return $elements;
378
+			}
371 379
 		}
372 380
 		return null;
373 381
 	}
Please login to merge, or discard this patch.
Ajax/service/JArray.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,21 +14,24 @@  discard block
 block discarded – undo
14 14
 			return $array[$key];
15 15
 		}
16 16
 		$values=array_values($array);
17
-		if ($pos < sizeof($values))
18
-			return $values[$pos];
17
+		if ($pos < sizeof($values)) {
18
+					return $values[$pos];
19
+		}
19 20
 	}
20 21
 
21 22
 	public static function getConditionalValue($array, $key, $condition) {
22 23
 		$result=NULL;
23 24
 		if (array_key_exists($key, $array)) {
24 25
 			$result=$array[$key];
25
-			if ($condition($result) === true)
26
-				return $result;
26
+			if ($condition($result) === true) {
27
+							return $result;
28
+			}
27 29
 		}
28 30
 		$values=array_values($array);
29 31
 		foreach ( $values as $val ) {
30
-			if ($condition($val) === true)
31
-				return $val;
32
+			if ($condition($val) === true) {
33
+							return $val;
34
+			}
32 35
 		}
33 36
 		return $result;
34 37
 	}
@@ -36,8 +39,9 @@  discard block
 block discarded – undo
36 39
 	public static function getDefaultValue($array, $key, $default=NULL) {
37 40
 		if (array_key_exists($key, $array)) {
38 41
 			return $array[$key];
39
-		} else
40
-			return $default;
42
+		} else {
43
+					return $default;
44
+		}
41 45
 	}
42 46
 
43 47
 	public static function implode($glue, $pieces) {
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlTable.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -165,8 +165,9 @@
 block discarded – undo
165 165
 	}
166 166
 
167 167
 	public function setBasic($very=false) {
168
-		if ($very)
169
-			$this->addToPropertyCtrl("class", "very", array ("very" ));
168
+		if ($very) {
169
+					$this->addToPropertyCtrl("class", "very", array ("very" ));
170
+		}
170 171
 		return $this->addToPropertyCtrl("class", "basic", array ("basic" ));
171 172
 	}
172 173
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) {
24 24
 		parent::__construct($identifier, $tagName, "");
25
-		if (isset($rowCount) && isset($colCount))
26
-			$this->setRowCount($rowCount, $colCount);
25
+		if (isset($rowCount) && isset($colCount)) {
26
+					$this->setRowCount($rowCount, $colCount);
27
+		}
27 28
 	}
28 29
 
29 30
 	/**
@@ -129,8 +130,9 @@  discard block
 block discarded – undo
129 130
 			$values=\array_fill(0, $count, $values);
130 131
 			$isArray=false;
131 132
 		}
132
-		if (JArray::dimension($values) == 1 && $isArray)
133
-			$values=[ $values ];
133
+		if (JArray::dimension($values) == 1 && $isArray) {
134
+					$values=[ $values ];
135
+		}
134 136
 
135 137
 		$count=\min(\sizeof($values), $count);
136 138
 
@@ -174,8 +176,9 @@  discard block
 block discarded – undo
174 176
 		$count=$this->count();
175 177
 		for($i=0; $i < $count; $i++) {
176 178
 			$index=$this->content[$i]->getColPosition($colIndex);
177
-			if ($index !== NULL)
178
-				$this->getCell($i, $index)->$function();
179
+			if ($index !== NULL) {
180
+							$this->getCell($i, $index)->$function();
181
+			}
179 182
 		}
180 183
 		return $this;
181 184
 	}
@@ -206,8 +209,9 @@  discard block
 block discarded – undo
206 209
 	 */
207 210
 	public function getColCount() {
208 211
 		$result=0;
209
-		if ($this->count() > 0)
210
-			$result=$this->getItem(0)->getColCount();
212
+		if ($this->count() > 0) {
213
+					$result=$this->getItem(0)->getColCount();
214
+		}
211 215
 		return $result;
212 216
 	}
213 217
 
Please login to merge, or discard this patch.