Completed
Push — master ( 735cac...641d44 )
by Jean-Christophe
04:20
created
Ajax/semantic/html/elements/HtmlInput.php 2 patches
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.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 	use IconTrait;
13 13
 
14 14
 	public function __construct($identifier, $type="text", $value="", $placeholder="") {
15
-		parent::__construct("div-" . $identifier, "div", "ui input");
16
-		$this->content=[ "field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder) ];
17
-		$this->_states=[ State::DISABLED,State::FOCUS,State::ERROR ];
18
-		$this->_variations=[ Variation::TRANSPARENT ];
15
+		parent::__construct("div-".$identifier, "div", "ui input");
16
+		$this->content=["field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder)];
17
+		$this->_states=[State::DISABLED, State::FOCUS, State::ERROR];
18
+		$this->_variations=[Variation::TRANSPARENT];
19 19
 	}
20 20
 
21 21
 	public function setFocus() {
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	}
24 24
 
25 25
 	public function addLoading() {
26
-		if ($this->_hasIcon === false) {
26
+		if ($this->_hasIcon===false) {
27 27
 			throw new \Exception("Input must have an icon for showing a loader, use addIcon before");
28 28
 		}
29 29
 		return $this->addToProperty("class", State::LOADING);
@@ -31,31 +31,31 @@  discard block
 block discarded – undo
31 31
 
32 32
 	public function labeled($label, $direction=Direction::LEFT, $icon=NULL) {
33 33
 		$labelO=$label;
34
-		if (\is_object($label) === false) {
35
-			$labelO=new HtmlLabel("label-" . $this->identifier, $label);
34
+		if (\is_object($label)===false) {
35
+			$labelO=new HtmlLabel("label-".$this->identifier, $label);
36 36
 			if (isset($icon))
37 37
 				$labelO->addIcon($icon);
38
-		} else {
39
-			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
38
+		}else {
39
+			$labelO->addToPropertyCtrl("class", "label", array("label"));
40 40
 		}
41
-		$this->addToProperty("class", $direction . " labeled");
42
-		$this->addContent($labelO, \strstr($direction, Direction::LEFT) !== false);
41
+		$this->addToProperty("class", $direction." labeled");
42
+		$this->addContent($labelO, \strstr($direction, Direction::LEFT)!==false);
43 43
 		return $labelO;
44 44
 	}
45 45
 
46 46
 	public function labeledToCorner($label, $direction=Direction::LEFT, $icon=NULL) {
47
-		return $this->labeled($label, $direction . " corner", $icon)->toCorner($direction);
47
+		return $this->labeled($label, $direction." corner", $icon)->toCorner($direction);
48 48
 	}
49 49
 
50 50
 	public function addAction($action, $direction=Direction::LEFT, $icon=NULL, $labeled=false) {
51 51
 		$actionO=$action;
52
-		if (\is_object($action) === false) {
53
-			$actionO=new HtmlButton("action-" . $this->identifier, $action);
52
+		if (\is_object($action)===false) {
53
+			$actionO=new HtmlButton("action-".$this->identifier, $action);
54 54
 			if (isset($icon))
55 55
 				$actionO->addIcon($icon, true, $labeled);
56 56
 		}
57
-		$this->addToProperty("class", $direction . " action");
58
-		$this->addContent($actionO, \strstr($direction, Direction::LEFT) !== false);
57
+		$this->addToProperty("class", $direction." action");
58
+		$this->addContent($actionO, \strstr($direction, Direction::LEFT)!==false);
59 59
 		return $actionO;
60 60
 	}
61 61
 
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 3 patches
Doc Comments   +35 added lines patch added patch discarded remove patch
@@ -141,22 +141,36 @@  discard block
 block discarded – undo
141 141
 		return $this;
142 142
 	}
143 143
 
144
+	/**
145
+	 * @param string $name
146
+	 * @param string $value
147
+	 */
144 148
 	protected function removePropertyValue($name, $value) {
145 149
 		$this->properties[$name]=\str_replace($value, "", $this->properties[$name]);
146 150
 		return $this;
147 151
 	}
148 152
 
153
+	/**
154
+	 * @param string $name
155
+	 */
149 156
 	protected function removePropertyValues($name, $values) {
150 157
 		$this->removeOldValues($this->properties[$name], $values);
151 158
 		return $this;
152 159
 	}
153 160
 
161
+	/**
162
+	 * @param string $name
163
+	 */
154 164
 	protected function removeProperty($name) {
155 165
 		if (\array_key_exists($name, $this->properties))
156 166
 			unset($this->properties[$name]);
157 167
 		return $this;
158 168
 	}
159 169
 
170
+	/**
171
+	 * @param string $name
172
+	 * @param string[] $typeCtrl
173
+	 */
160 174
 	protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
161 175
 		if ($this->ctrl($name, $value, $typeCtrl) === true) {
162 176
 			if (is_array($typeCtrl)) {
@@ -181,6 +195,9 @@  discard block
 block discarded – undo
181 195
 		return $this->addToProperty($name, $value);
182 196
 	}
183 197
 
198
+	/**
199
+	 * @param string $name
200
+	 */
184 201
 	public function addToPropertyCtrl($name, $value, $typeCtrl) {
185 202
 		return $this->addToPropertyUnique($name, $value, $typeCtrl);
186 203
 	}
@@ -321,6 +338,9 @@  discard block
 block discarded – undo
321 338
 		}
322 339
 	}
323 340
 
341
+	/**
342
+	 * @param string $operation
343
+	 */
324 344
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
325 345
 		$params=array ("url" => $url,"responseElement" => $responseElement );
326 346
 		$params=array_merge($params, $parameters);
@@ -328,14 +348,23 @@  discard block
 block discarded – undo
328 348
 		return $this;
329 349
 	}
330 350
 
351
+	/**
352
+	 * @param string $event
353
+	 */
331 354
 	public function getOn($event, $url, $responseElement="", $parameters=array()) {
332 355
 		return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters);
333 356
 	}
334 357
 
358
+	/**
359
+	 * @param string $url
360
+	 */
335 361
 	public function getOnClick($url, $responseElement="", $parameters=array()) {
336 362
 		return $this->getOn("click", $url, $responseElement, $parameters);
337 363
 	}
338 364
 
365
+	/**
366
+	 * @param string $event
367
+	 */
339 368
 	public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) {
340 369
 		$parameters["params"]=$params;
341 370
 		return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters);
@@ -345,6 +374,9 @@  discard block
 block discarded – undo
345 374
 		return $this->postOn("click", $url, $params, $responseElement, $parameters);
346 375
 	}
347 376
 
377
+	/**
378
+	 * @param string $event
379
+	 */
348 380
 	public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) {
349 381
 		$parameters["form"]=$form;
350 382
 		return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters);
@@ -394,6 +426,9 @@  discard block
 block discarded – undo
394 426
 		return $value;
395 427
 	}
396 428
 
429
+	/**
430
+	 * @param string $jqueryCall
431
+	 */
397 432
 	public function jsDoJquery($jqueryCall, $param="") {
398 433
 		return "$('#" . $this->identifier . "')." . $jqueryCall . "(" . $this->_prep_value($param) . ");";
399 434
 	}
Please login to merge, or discard this 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.
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 abstract class BaseHtml extends BaseWidget {
18 18
 	protected $_template;
19 19
 	protected $tagName;
20
-	protected $properties=array ();
21
-	protected $_events=array ();
22
-	protected $_wrapBefore=array ();
23
-	protected $_wrapAfter=array ();
20
+	protected $properties=array();
21
+	protected $_events=array();
22
+	protected $_wrapBefore=array();
23
+	protected $_wrapAfter=array();
24 24
 	protected $_bsComponent;
25 25
 
26 26
 	public function getBsComponent() {
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	protected function getTemplate(JsUtils $js=NULL) {
36
-		return PropertyWrapper::wrap($this->_wrapBefore, $js) . $this->_template . PropertyWrapper::wrap($this->_wrapAfter, $js);
36
+		return PropertyWrapper::wrap($this->_wrapBefore, $js).$this->_template.PropertyWrapper::wrap($this->_wrapAfter, $js);
37 37
 	}
38 38
 
39 39
 	public function getProperties() {
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function addToProperty($name, $value, $separator=" ") {
59 59
 		if (\is_array($value)) {
60
-			foreach ( $value as $v ) {
60
+			foreach ($value as $v) {
61 61
 				$this->addToProperty($name, $v, $separator);
62 62
 			}
63
-		} else if ($value !== "" && $this->propertyContains($name, $value) === false) {
63
+		}else if ($value!=="" && $this->propertyContains($name, $value)===false) {
64 64
 			$v=@$this->properties[$name];
65
-			if (isset($v) && $v !== "")
66
-				$v=$v . $separator . $value;
65
+			if (isset($v) && $v!=="")
66
+				$v=$v.$separator.$value;
67 67
 			else
68 68
 				$v=$value;
69 69
 			
@@ -79,23 +79,23 @@  discard block
 block discarded – undo
79 79
 
80 80
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
81 81
 		$result=$this->getTemplate($js);
82
-		foreach ( $this as $key => $value ) {
83
-			if (PhalconUtils::startsWith($key, "_") === false && $key !== "events") {
82
+		foreach ($this as $key => $value) {
83
+			if (PhalconUtils::startsWith($key, "_")===false && $key!=="events") {
84 84
 				if (is_array($value)) {
85 85
 					$v=PropertyWrapper::wrap($value, $js);
86
-				} else {
86
+				}else {
87 87
 					$v=$value;
88 88
 				}
89
-				$result=str_ireplace("%" . $key . "%", $v, $result);
89
+				$result=str_ireplace("%".$key."%", $v, $result);
90 90
 			}
91 91
 		}
92 92
 		if (isset($js)) {
93 93
 			$this->run($js);
94 94
 		}
95
-		if (isset($view) === true) {
95
+		if (isset($view)===true) {
96 96
 			$controls=$view->getVar("q");
97
-			if (isset($controls) === false) {
98
-				$controls=array ();
97
+			if (isset($controls)===false) {
98
+				$controls=array();
99 99
 			}
100 100
 			$controls[$this->identifier]=$result;
101 101
 			$view->setVar("q", $controls);
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
 
106 106
 	protected function ctrl($name, $value, $typeCtrl) {
107 107
 		if (is_array($typeCtrl)) {
108
-			if (array_search($value, $typeCtrl) === false) {
109
-				throw new \Exception("La valeur passée a propriété `" . $name . "` ne fait pas partie des valeurs possibles : {" . implode(",", $typeCtrl) . "}");
108
+			if (array_search($value, $typeCtrl)===false) {
109
+				throw new \Exception("La valeur passée a propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
110 110
 			}
111
-		} else {
111
+		}else {
112 112
 			if (!$typeCtrl($value)) {
113
-				throw new \Exception("La fonction " . $typeCtrl . " a retourné faux pour l'affectation de la propriété " . $name);
113
+				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name);
114 114
 			}
115 115
 		}
116 116
 		return true;
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
 	}
126 126
 
127 127
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
128
-		if ($this->ctrl($name, $value, $typeCtrl) === true)
128
+		if ($this->ctrl($name, $value, $typeCtrl)===true)
129 129
 			return $this->setProperty($name, $value);
130 130
 		return $this;
131 131
 	}
132 132
 
133 133
 	protected function setMemberCtrl(&$name, $value, $typeCtrl) {
134
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
134
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
135 135
 			return $name=$value;
136 136
 		}
137 137
 		return $this;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	protected function addToMemberUnique(&$name, $value, $typeCtrl, $separator=" ") {
141 141
 		if (is_array($typeCtrl)) {
142 142
 			$this->removeOldValues($name, $typeCtrl);
143
-			$name.=$separator . $value;
143
+			$name.=$separator.$value;
144 144
 		}
145 145
 		return $this;
146 146
 	}
@@ -162,17 +162,17 @@  discard block
 block discarded – undo
162 162
 	}
163 163
 
164 164
 	protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
165
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
165
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
166 166
 			if (is_array($typeCtrl)) {
167 167
 				$this->removeOldValues($name, $typeCtrl);
168 168
 			}
169
-			$name.=$separator . $value;
169
+			$name.=$separator.$value;
170 170
 		}
171 171
 		return $this;
172 172
 	}
173 173
 
174 174
 	protected function addToMember(&$name, $value, $separator=" ") {
175
-		$name=str_ireplace($value, "", $name) . $separator . $value;
175
+		$name=str_ireplace($value, "", $name).$separator.$value;
176 176
 		return $this;
177 177
 	}
178 178
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	}
191 191
 
192 192
 	public function addToPropertyCtrlCheck($name, $value, $typeCtrl) {
193
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
193
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
194 194
 			return $this->addToProperty($name, $value);
195 195
 		}
196 196
 		return $this;
@@ -218,28 +218,28 @@  discard block
 block discarded – undo
218 218
 	}
219 219
 
220 220
 	public function fromArray($array) {
221
-		foreach ( $this as $key => $value ) {
221
+		foreach ($this as $key => $value) {
222 222
 			if (array_key_exists($key, $array) && !PhalconUtils::startsWith($key, "_")) {
223
-				$setter="set" . ucfirst($key);
223
+				$setter="set".ucfirst($key);
224 224
 				$this->$setter($array[$key]);
225 225
 				unset($array[$key]);
226 226
 			}
227 227
 		}
228
-		foreach ( $array as $key => $value ) {
228
+		foreach ($array as $key => $value) {
229 229
 			if (method_exists($this, $key)) {
230 230
 				try {
231 231
 					$this->$key($value);
232 232
 					unset($array[$key]);
233
-				} catch ( \Exception $e ) {
233
+				} catch (\Exception $e) {
234 234
 					// Nothing to do
235 235
 				}
236
-			} else {
237
-				$setter="set" . ucfirst($key);
236
+			}else {
237
+				$setter="set".ucfirst($key);
238 238
 				if (method_exists($this, $setter)) {
239 239
 					try {
240 240
 						$this->$setter($value);
241 241
 						unset($array[$key]);
242
-					} catch ( \Exception $e ) {
242
+					} catch (\Exception $e) {
243 243
 						// Nothing to do
244 244
 					}
245 245
 				}
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 
251 251
 	public function fromDatabaseObjects($objects, $function) {
252 252
 		if (isset($objects)) {
253
-			foreach ( $objects as $object ) {
253
+			foreach ($objects as $object) {
254 254
 				$this->fromDatabaseObject($object, $function);
255 255
 			}
256 256
 		}
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 	}
270 270
 
271 271
 	public function addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
272
-		if ($stopPropagation === true) {
273
-			$jsCode="event.stopPropagation();" . $jsCode;
272
+		if ($stopPropagation===true) {
273
+			$jsCode="event.stopPropagation();".$jsCode;
274 274
 		}
275
-		if ($preventDefault === true) {
276
-			$jsCode="event.preventDefault();" . $jsCode;
275
+		if ($preventDefault===true) {
276
+			$jsCode="event.preventDefault();".$jsCode;
277 277
 		}
278 278
 		return $this->_addEvent($event, $jsCode);
279 279
 	}
@@ -282,10 +282,10 @@  discard block
 block discarded – undo
282 282
 		if (array_key_exists($event, $this->_events)) {
283 283
 			if (is_array($this->_events[$event])) {
284 284
 				$this->_events[$event][]=$jsCode;
285
-			} else {
286
-				$this->_events[$event]=array ($this->_events[$event],$jsCode );
285
+			}else {
286
+				$this->_events[$event]=array($this->_events[$event], $jsCode);
287 287
 			}
288
-		} else {
288
+		}else {
289 289
 			$this->_events[$event]=$jsCode;
290 290
 		}
291 291
 		return $this;
@@ -305,15 +305,15 @@  discard block
 block discarded – undo
305 305
 
306 306
 	public function addEventsOnRun(JsUtils $js) {
307 307
 		if (isset($this->_bsComponent)) {
308
-			foreach ( $this->_events as $event => $jsCode ) {
308
+			foreach ($this->_events as $event => $jsCode) {
309 309
 				$code=$jsCode;
310 310
 				if (is_array($jsCode)) {
311 311
 					$code="";
312
-					foreach ( $jsCode as $jsC ) {
312
+					foreach ($jsCode as $jsC) {
313 313
 						if ($jsC instanceof AjaxCall) {
314
-							$code.="\n" . $jsC->compile($js);
315
-						} else {
316
-							$code.="\n" . $jsC;
314
+							$code.="\n".$jsC->compile($js);
315
+						}else {
316
+							$code.="\n".$jsC;
317 317
 						}
318 318
 					}
319 319
 				} elseif ($jsCode instanceof AjaxCall) {
@@ -321,12 +321,12 @@  discard block
 block discarded – undo
321 321
 				}
322 322
 				$this->_bsComponent->addEvent($event, $code);
323 323
 			}
324
-			$this->_events=array ();
324
+			$this->_events=array();
325 325
 		}
326 326
 	}
327 327
 
328 328
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
329
-		$params=array ("url" => $url,"responseElement" => $responseElement );
329
+		$params=array("url" => $url, "responseElement" => $responseElement);
330 330
 		$params=array_merge($params, $parameters);
331 331
 		$this->_addEvent($event, new AjaxCall($operation, $params));
332 332
 		return $this;
@@ -362,15 +362,15 @@  discard block
 block discarded – undo
362 362
 		if (is_array($elements)) {
363 363
 			$flag=false;
364 364
 			$index=0;
365
-			while ( !$flag && $index < sizeof($elements) ) {
365
+			while (!$flag && $index<sizeof($elements)) {
366 366
 				if ($elements[$index] instanceof BaseHtml)
367
-					$flag=($elements[$index]->getIdentifier() === $identifier);
367
+					$flag=($elements[$index]->getIdentifier()===$identifier);
368 368
 				$index++;
369 369
 			}
370
-			if ($flag === true)
371
-				return $elements[$index - 1];
370
+			if ($flag===true)
371
+				return $elements[$index-1];
372 372
 		} elseif ($elements instanceof BaseHtml) {
373
-			if ($elements->getIdentifier() === $identifier)
373
+			if ($elements->getIdentifier()===$identifier)
374 374
 				return $elements;
375 375
 		}
376 376
 		return null;
@@ -392,14 +392,14 @@  discard block
 block discarded – undo
392 392
 		if (is_array($value)) {
393 393
 			$value=implode(",", $value);
394 394
 		}
395
-		if (strrpos($value, 'this') === false && strrpos($value, 'event') === false) {
396
-			$value='"' . $value . '"';
395
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) {
396
+			$value='"'.$value.'"';
397 397
 		}
398 398
 		return $value;
399 399
 	}
400 400
 
401 401
 	public function jsDoJquery($jqueryCall, $param="") {
402
-		return "$('#" . $this->identifier . "')." . $jqueryCall . "(" . $this->_prep_value($param) . ");";
402
+		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
403 403
 	}
404 404
 
405 405
 	public function executeOnRun($jsCode) {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegment.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
  * @version 1.001
18 18
  */
19 19
 class HtmlSegment extends HtmlSemDoubleElement {
20
-	use AttachedTrait,TextAlignmentTrait;
20
+	use AttachedTrait, TextAlignmentTrait;
21 21
 
22 22
 	public function __construct($identifier, $content="") {
23 23
 		parent::__construct($identifier, "div", "ui segment");
24
-		$this->_variations=\array_merge($this->_variations, [ Variation::PADDED,Variation::COMPACT ]);
25
-		$this->_states=\array_merge($this->_states, [ State::LOADING ]);
24
+		$this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]);
25
+		$this->_states=\array_merge($this->_states, [State::LOADING]);
26 26
 		$this->content=$content;
27 27
 	}
28 28
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	}
37 37
 
38 38
 	public function setSens($sens="vertical") {
39
-		return $this->addToPropertyCtrl("class", $sens, array ("vertical","horizontal" ));
39
+		return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal"));
40 40
 	}
41 41
 
42 42
 	public function setEmphasis($value=Emphasis::SECONDARY) {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButton.php 3 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	}
55 55
 
56 56
 	public function setFocusable($value=true) {
57
-		if ($value === true)
57
+		if ($value===true)
58 58
 			$this->setProperty("tabindex", "0");
59 59
 		else {
60 60
 			$this->removeProperty("tabindex");
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function setAnimated($content, $animation="") {
66 66
 		$this->setTagName("div");
67
-		$this->addToProperty("class", "animated " . $animation);
68
-		$visible=new HtmlSemDoubleElement("visible-" . $this->identifier, "div");
67
+		$this->addToProperty("class", "animated ".$animation);
68
+		$visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div");
69 69
 		$visible->setClass("visible content");
70 70
 		$visible->setContent($this->content);
71
-		$hidden=new HtmlSemDoubleElement("hidden-" . $this->identifier, "div");
71
+		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div");
72 72
 		$hidden->setClass("hidden content");
73 73
 		$hidden->setContent($content);
74
-		$this->content=array ($visible,$hidden );
74
+		$this->content=array($visible, $hidden);
75 75
 		return $hidden;
76 76
 	}
77 77
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	public function asIcon($icon) {
84 84
 		$iconO=$icon;
85 85
 		if (\is_string($icon)) {
86
-			$iconO=new HtmlIcon("icon-" . $this->identifier, $icon);
86
+			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
87 87
 		}
88 88
 		$this->addToProperty("class", "icon");
89 89
 		$this->content=$iconO;
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 	public function addLabel($caption, $before=false) {
105 105
 		$this->tagName="div";
106 106
 		$this->addToProperty("class", "labeled");
107
-		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
107
+		$this->content=new HtmlButton("button-".$this->identifier, $this->content);
108 108
 		$this->content->setTagName("div");
109
-		$label=new HtmlLabel("label-" . $this->identifier, $caption, "a");
109
+		$label=new HtmlLabel("label-".$this->identifier, $caption, "a");
110 110
 		$label->setBasic();
111 111
 		$this->addContent($label, $before);
112 112
 		return $label;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function fromArray($array) {
120 120
 		$array=parent::fromArray($array);
121
-		foreach ( $array as $key => $value ) {
121
+		foreach ($array as $key => $value) {
122 122
 			$this->setProperty($key, $value);
123 123
 		}
124 124
 		return $array;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	}
182 182
 
183 183
 	public static function social($identifier, $social, $value=NULL) {
184
-		if ($value === NULL)
184
+		if ($value===NULL)
185 185
 			$value=\ucfirst($social);
186 186
 		$return=new HtmlButton($identifier, $value);
187 187
 		$return->addIcon($social);
Please login to merge, or discard this 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.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	/**
38 38
 	 * Set the button value
39 39
 	 * @param string $value
40
-	 * @return \Ajax\semantic\html\HtmlButton
40
+	 * @return HtmlButton
41 41
 	 */
42 42
 	public function setValue($value) {
43 43
 		$this->content=$value;
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
 	/**
48 48
 	 * define the button style
49
-	 * @param string|int $cssStyle
50
-	 * @return \Ajax\semantic\html\HtmlButton default : ""
49
+	 * @param string $cssStyle
50
+	 * @return HtmlButton default : ""
51 51
 	 */
52 52
 	public function setStyle($cssStyle) {
53 53
 		return $this->addToProperty("class", $cssStyle);
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridCol.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
 	 */
31 31
 	public function setWidth($width) {
32 32
 		if (\is_int($width)) {
33
-			$width=Wide::getConstants()["W" . $width];
33
+			$width=Wide::getConstants()["W".$width];
34 34
 		}
35 35
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
36
-		return $this->addToPropertyCtrl("class", "wide", array ("wide" ));
36
+		return $this->addToPropertyCtrl("class", "wide", array("wide"));
37 37
 	}
38 38
 
39 39
 	public function setValue($value) {
Please login to merge, or discard this 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/semantic/html/base/traits/BaseTrait.php 3 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -11,12 +11,24 @@
 block discarded – undo
11 11
 	protected $_states=[ ];
12 12
 	protected $_baseClass;
13 13
 
14
+	/**
15
+	 * @param string $name
16
+	 */
14 17
 	protected abstract function setPropertyCtrl($name, $value, $typeCtrl);
15 18
 
19
+	/**
20
+	 * @param string $name
21
+	 */
16 22
 	protected abstract function addToPropertyCtrl($name, $value, $typeCtrl);
17 23
 
24
+	/**
25
+	 * @param string $name
26
+	 */
18 27
 	protected abstract function addToPropertyCtrlCheck($name, $value, $typeCtrl);
19 28
 
29
+	/**
30
+	 * @param string $name
31
+	 */
20 32
 	public abstract function addToProperty($name, $value, $separator=" ");
21 33
 
22 34
 	public function addVariation($variation) {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 use Ajax\semantic\html\base\constants\Direction;
8 8
 
9 9
 trait BaseTrait {
10
-	protected $_variations=[ ];
11
-	protected $_states=[ ];
10
+	protected $_variations=[];
11
+	protected $_states=[];
12 12
 	protected $_baseClass;
13 13
 
14 14
 	protected abstract function setPropertyCtrl($name, $value, $typeCtrl);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		$this->setProperty("class", $this->_baseClass);
37 37
 		if (\is_string($variations))
38 38
 			$variations=\explode(" ", $variations);
39
-		foreach ( $variations as $variation ) {
39
+		foreach ($variations as $variation) {
40 40
 			$this->addVariation($variation);
41 41
 		}
42 42
 		return $this;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	public function addVariations($variations=array()) {
51 51
 		if (\is_string($variations))
52 52
 			$variations=\explode(" ", $variations);
53
-		foreach ( $variations as $variation ) {
53
+		foreach ($variations as $variation) {
54 54
 			$this->addVariation($variation);
55 55
 		}
56 56
 		return $this;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	public function addStates($states=array()) {
60 60
 		if (\is_string($states))
61 61
 			$states=\explode(" ", $states);
62
-		foreach ( $states as $state ) {
62
+		foreach ($states as $state) {
63 63
 			$this->addState($state);
64 64
 		}
65 65
 		return $this;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		$this->setProperty("class", $this->_baseClass);
70 70
 		if (\is_string($states))
71 71
 			$states=\explode(" ", $states);
72
-		foreach ( $states as $state ) {
72
+		foreach ($states as $state) {
73 73
 			$this->addState($state);
74 74
 		}
75 75
 		return $this;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	}
123 123
 
124 124
 	public function setFloated($direction="right") {
125
-		return $this->addToPropertyCtrl("class", $direction . " floated", Direction::getConstantValues("floated"));
125
+		return $this->addToPropertyCtrl("class", $direction." floated", Direction::getConstantValues("floated"));
126 126
 	}
127 127
 
128 128
 	public function floatRight() {
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 
35 35
 	public function setVariations($variations) {
36 36
 		$this->setProperty("class", $this->_baseClass);
37
-		if (\is_string($variations))
38
-			$variations=\explode(" ", $variations);
37
+		if (\is_string($variations)) {
38
+					$variations=\explode(" ", $variations);
39
+		}
39 40
 		foreach ( $variations as $variation ) {
40 41
 			$this->addVariation($variation);
41 42
 		}
@@ -48,8 +49,9 @@  discard block
 block discarded – undo
48 49
 	}
49 50
 
50 51
 	public function addVariations($variations=array()) {
51
-		if (\is_string($variations))
52
-			$variations=\explode(" ", $variations);
52
+		if (\is_string($variations)) {
53
+					$variations=\explode(" ", $variations);
54
+		}
53 55
 		foreach ( $variations as $variation ) {
54 56
 			$this->addVariation($variation);
55 57
 		}
@@ -57,8 +59,9 @@  discard block
 block discarded – undo
57 59
 	}
58 60
 
59 61
 	public function addStates($states=array()) {
60
-		if (\is_string($states))
61
-			$states=\explode(" ", $states);
62
+		if (\is_string($states)) {
63
+					$states=\explode(" ", $states);
64
+		}
62 65
 		foreach ( $states as $state ) {
63 66
 			$this->addState($state);
64 67
 		}
@@ -67,8 +70,9 @@  discard block
 block discarded – undo
67 70
 
68 71
 	public function setStates($states) {
69 72
 		$this->setProperty("class", $this->_baseClass);
70
-		if (\is_string($states))
71
-			$states=\explode(" ", $states);
73
+		if (\is_string($states)) {
74
+					$states=\explode(" ", $states);
75
+		}
72 76
 		foreach ( $states as $state ) {
73 77
 			$this->addState($state);
74 78
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlTable.php 3 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -17,6 +17,11 @@  discard block
 block discarded – undo
17 17
 class HtmlTable extends HtmlSemDoubleElement {
18 18
 	private $_colCount;
19 19
 
20
+	/**
21
+	 * @param string $identifier
22
+	 * @param integer $rowCount
23
+	 * @param integer $colCount
24
+	 */
20 25
 	public function __construct($identifier, $rowCount, $colCount) {
21 26
 		parent::__construct($identifier, "table", "ui table");
22 27
 		$this->content=array ();
@@ -146,6 +151,9 @@  discard block
 block discarded – undo
146 151
 		return $this->colAlign($colIndex, "colLeft");
147 152
 	}
148 153
 
154
+	/**
155
+	 * @param string $function
156
+	 */
149 157
 	private function colAlign($colIndex, $function) {
150 158
 		if (\is_array($colIndex)) {
151 159
 			foreach ( $colIndex as $cIndex ) {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 	public function __construct($identifier, $rowCount, $colCount) {
21 21
 		parent::__construct($identifier, "table", "ui table");
22
-		$this->content=array ();
22
+		$this->content=array();
23 23
 		$this->setRowCount($rowCount, $colCount);
24
-		$this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ];
24
+		$this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT];
25 25
 	}
26 26
 
27 27
 	/**
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 	 * @return HtmlTableContent
31 31
 	 */
32 32
 	private function getPart($key) {
33
-		if (\array_key_exists($key, $this->content) === false) {
33
+		if (\array_key_exists($key, $this->content)===false) {
34 34
 			$this->content[$key]=new HtmlTableContent("", $key);
35
-			if ($key !== "tbody") {
35
+			if ($key!=="tbody") {
36 36
 				$this->content[$key]->setRowCount(1, $this->_colCount);
37 37
 			}
38 38
 		}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @return boolean
70 70
 	 */
71 71
 	public function hasPart($key) {
72
-		return \array_key_exists($key, $this->content) === true;
72
+		return \array_key_exists($key, $this->content)===true;
73 73
 	}
74 74
 
75 75
 	/**
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
 
149 149
 	private function colAlign($colIndex, $function) {
150 150
 		if (\is_array($colIndex)) {
151
-			foreach ( $colIndex as $cIndex ) {
151
+			foreach ($colIndex as $cIndex) {
152 152
 				$this->colAlign($cIndex, $function);
153 153
 			}
154
-		} else {
154
+		}else {
155 155
 			if ($this->hasPart("thead")) {
156 156
 				$this->getHeader()->$function($colIndex);
157 157
 			}
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 
167 167
 	public function setBasic($very=false) {
168 168
 		if ($very)
169
-			$this->addToPropertyCtrl("class", "very", array ("very" ));
170
-		return $this->addToPropertyCtrl("class", "basic", array ("basic" ));
169
+			$this->addToPropertyCtrl("class", "very", array("very"));
170
+		return $this->addToPropertyCtrl("class", "basic", array("basic"));
171 171
 	}
172 172
 
173 173
 	public function setCollapsing() {
@@ -228,9 +228,9 @@  discard block
 block discarded – undo
228 228
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
229 229
 	 */
230 230
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
231
-		$this->content=JArray::sortAssociative($this->content, [ "thead","tbody","tfoot" ]);
231
+		$this->content=JArray::sortAssociative($this->content, ["thead", "tbody", "tfoot"]);
232 232
 		if ($this->propertyContains("class", "sortable")) {
233
-			$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();");
233
+			$this->addEvent("execute", "$('#".$this->identifier."').tablesort();");
234 234
 		}
235 235
 		return parent::compile($js, $view);
236 236
 	}
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		$result=$function($object);
246 246
 		if (\is_array($result)) {
247 247
 			return $this->addRow($function($object));
248
-		} else {
248
+		}else {
249 249
 			return $this->getBody()->_addRow($result);
250 250
 		}
251 251
 	}
Please login to merge, or discard this 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 3 patches
Doc Comments   +10 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,10 +68,16 @@  discard block
 block discarded – undo
68 68
 		return $tr;
69 69
 	}
70 70
 
71
+	/**
72
+	 * @param integer $value
73
+	 */
71 74
 	public function newRow($value) {
72 75
 		return $this->createItem($value);
73 76
 	}
74 77
 
78
+	/**
79
+	 * @param integer $colCount
80
+	 */
75 81
 	public function addRow($colCount) {
76 82
 		return $this->addItem($colCount);
77 83
 	}
@@ -97,7 +103,7 @@  discard block
 block discarded – undo
97 103
 	/**
98 104
 	 *
99 105
 	 * @param int $index
100
-	 * @return \Ajax\semantic\html\content\HtmlTR
106
+	 * @return \Ajax\common\html\HtmlDoubleElement
101 107
 	 */
102 108
 	public function getRow($index) {
103 109
 		return $this->getItem($index);
@@ -170,6 +176,9 @@  discard block
 block discarded – undo
170 176
 		return $this;
171 177
 	}
172 178
 
179
+	/**
180
+	 * @param string $function
181
+	 */
173 182
 	private function colAlign($colIndex, $function) {
174 183
 		$count=$this->count();
175 184
 		for($i=0; $i < $count; $i++) {
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  *
12 12
  */
13 13
 class HtmlTableContent extends HtmlSemCollection {
14
-	protected $_tdTagNames=[ "thead" => "th","tbody" => "td","tfoot" => "th" ];
14
+	protected $_tdTagNames=["thead" => "th", "tbody" => "td", "tfoot" => "th"];
15 15
 
16 16
 	/**
17 17
 	 *
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public function setRowCount($rowCount, $colCount) {
36 36
 		$count=$this->count();
37
-		for($i=$count; $i < $rowCount; $i++) {
37
+		for ($i=$count; $i<$rowCount; $i++) {
38 38
 			$this->addItem($colCount);
39 39
 		}
40 40
 		/*
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		$tr=new HtmlTR("", $value);
63 63
 		$tr->setContainer($this, $count);
64 64
 		$tr->setTdTagName($this->_tdTagNames[$this->tagName]);
65
-		if (isset($value) === true) {
65
+		if (isset($value)===true) {
66 66
 			$tr->setColCount($value);
67 67
 		}
68 68
 		return $tr;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function setCellValue($row, $col, $value="") {
114 114
 		$cell=$this->getCell($row, $col);
115
-		if (isset($cell) === true) {
115
+		if (isset($cell)===true) {
116 116
 			$cell->setValue($value);
117 117
 		}
118 118
 		return $this;
@@ -125,16 +125,16 @@  discard block
 block discarded – undo
125 125
 	public function setValues($values=array()) {
126 126
 		$count=$this->count();
127 127
 		$isArray=true;
128
-		if (\is_array($values) === false) {
128
+		if (\is_array($values)===false) {
129 129
 			$values=\array_fill(0, $count, $values);
130 130
 			$isArray=false;
131 131
 		}
132
-		if (JArray::dimension($values) == 1 && $isArray)
133
-			$values=[ $values ];
132
+		if (JArray::dimension($values)==1 && $isArray)
133
+			$values=[$values];
134 134
 
135 135
 		$count=\min(\sizeof($values), $count);
136 136
 
137
-		for($i=0; $i < $count; $i++) {
137
+		for ($i=0; $i<$count; $i++) {
138 138
 			$row=$this->content[$i];
139 139
 			$row->setValues($values[$i]);
140 140
 		}
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
 
144 144
 	public function setColValues($colIndex, $values=array()) {
145 145
 		$count=$this->count();
146
-		if (\is_array($values) === false) {
146
+		if (\is_array($values)===false) {
147 147
 			$values=\array_fill(0, $count, $values);
148 148
 		}
149 149
 		$count=\min(\sizeof($values), $count);
150
-		for($i=0; $i < $count; $i++) {
150
+		for ($i=0; $i<$count; $i++) {
151 151
 			$this->getCell($i, $colIndex)->setValue($values[$i]);
152 152
 		}
153 153
 		return $this;
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 	public function addColVariations($colIndex, $variations=array()) {
157 157
 		$count=$this->count();
158
-		for($i=0; $i < $count; $i++) {
158
+		for ($i=0; $i<$count; $i++) {
159 159
 			$this->getCell($i, $colIndex)->addVariations($variations);
160 160
 		}
161 161
 		return $this;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
 	public function setRowValues($rowIndex, $values=array()) {
165 165
 		$count=$this->count();
166
-		if (\is_array($values) === false) {
166
+		if (\is_array($values)===false) {
167 167
 			$values=\array_fill(0, $count, $values);
168 168
 		}
169 169
 		$this->getItem($rowIndex)->setValues($values);
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
 
173 173
 	private function colAlign($colIndex, $function) {
174 174
 		$count=$this->count();
175
-		for($i=0; $i < $count; $i++) {
175
+		for ($i=0; $i<$count; $i++) {
176 176
 			$index=$this->content[$i]->getColPosition($colIndex);
177
-			if ($index !== NULL)
177
+			if ($index!==NULL)
178 178
 				$this->getCell($i, $index)->$function();
179 179
 		}
180 180
 		return $this;
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	 */
207 207
 	public function getColCount() {
208 208
 		$result=0;
209
-		if ($this->count() > 0)
209
+		if ($this->count()>0)
210 210
 			$result=$this->getItem(0)->getColCount();
211 211
 		return $result;
212 212
 	}
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 	public function delete($rowIndex, $colIndex=NULL) {
221 221
 		if (isset($colIndex)) {
222 222
 			$row=$this->getItem($rowIndex);
223
-			if (isset($row) === true) {
223
+			if (isset($row)===true) {
224 224
 				$row->delete($colIndex);
225 225
 			}
226
-		} else {
226
+		}else {
227 227
 			$this->removeItem($rowIndex);
228 228
 		}
229 229
 		return $this;
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	 */
253 253
 	public function conditionalCellFormat($callback, $format) {
254 254
 		$rows=$this->content;
255
-		foreach ( $rows as $row ) {
255
+		foreach ($rows as $row) {
256 256
 			$row->conditionalCellFormat($callback, $format);
257 257
 		}
258 258
 		return $this;
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	public function conditionalRowFormat($callback, $format) {
267 267
 		$rows=$this->content;
268
-		foreach ( $rows as $row ) {
268
+		foreach ($rows as $row) {
269 269
 			$row->conditionalRowFormat($callback, $format);
270 270
 		}
271 271
 		return $this;
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	 */
278 278
 	public function applyCells($callback) {
279 279
 		$rows=$this->content;
280
-		foreach ( $rows as $row ) {
280
+		foreach ($rows as $row) {
281 281
 			$row->applyCells($callback);
282 282
 		}
283 283
 		return $this;
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	 */
290 290
 	public function applyRows($callback) {
291 291
 		$rows=$this->content;
292
-		foreach ( $rows as $row ) {
292
+		foreach ($rows as $row) {
293 293
 			$row->apply($callback);
294 294
 		}
295 295
 		return $this;
Please login to merge, or discard this 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.
Ajax/service/JArray.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 class JArray {
6 6
 
7 7
 	public static function isAssociative($array) {
8
-		return (array_values($array) !== $array);
8
+		return (array_values($array)!==$array);
9 9
 		// return (array_keys($array)!==range(0, count($array)-1));
10 10
 	}
11 11
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 			return $array[$key];
15 15
 		}
16 16
 		$values=array_values($array);
17
-		if ($pos < sizeof($values))
17
+		if ($pos<sizeof($values))
18 18
 			return $values[$pos];
19 19
 	}
20 20
 
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
 		$result=NULL;
23 23
 		if (array_key_exists($key, $array)) {
24 24
 			$result=$array[$key];
25
-			if ($condition($result) === true)
25
+			if ($condition($result)===true)
26 26
 				return $result;
27 27
 		}
28 28
 		$values=array_values($array);
29
-		foreach ( $values as $val ) {
30
-			if ($condition($val) === true)
29
+		foreach ($values as $val) {
30
+			if ($condition($val)===true)
31 31
 				return $val;
32 32
 		}
33 33
 		return $result;
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	public static function getDefaultValue($array, $key, $default=NULL) {
37 37
 		if (array_key_exists($key, $array)) {
38 38
 			return $array[$key];
39
-		} else
39
+		}else
40 40
 			return $default;
41 41
 	}
42 42
 
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 		$result="";
45 45
 		if (\is_array($glue)) {
46 46
 			$size=\sizeof($pieces);
47
-			if ($size > 0) {
48
-				for($i=0; $i < $size - 1; $i++) {
49
-					$result.=$pieces[$i] . @$glue[$i];
47
+			if ($size>0) {
48
+				for ($i=0; $i<$size-1; $i++) {
49
+					$result.=$pieces[$i].@$glue[$i];
50 50
 				}
51
-				$result.=$pieces[$size - 1];
51
+				$result.=$pieces[$size-1];
52 52
 			}
53
-		} else {
53
+		}else {
54 54
 			$result=\implode($glue, $pieces);
55 55
 		}
56 56
 		return $result;
@@ -58,16 +58,16 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public static function dimension($array) {
60 60
 		if (is_array(reset($array))) {
61
-			$return=self::dimension(reset($array)) + 1;
62
-		} else {
61
+			$return=self::dimension(reset($array))+1;
62
+		}else {
63 63
 			$return=1;
64 64
 		}
65 65
 		return $return;
66 66
 	}
67 67
 
68 68
 	public static function sortAssociative($array, $sortedKeys=array()) {
69
-		$newArray=array ();
70
-		foreach ( $sortedKeys as $key ) {
69
+		$newArray=array();
70
+		foreach ($sortedKeys as $key) {
71 71
 			if (\array_key_exists($key, $array)) {
72 72
 				$newArray[$key]=$array[$key];
73 73
 			}
Please login to merge, or discard this 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.