Passed
Push — master ( dcc4d7...852993 )
by Jean-Christophe
01:54
created
Ajax/bootstrap/html/HtmlDropdown.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	public function addItem($caption, $href="#") {
91 91
 		if($caption instanceof HtmlDropdownItem){
92 92
 			$item=$caption;
93
-		}else{
93
+		} else{
94 94
 			$iid=$this->getItemsCount()+1;
95 95
 			$item=new HtmlDropdownItem($this->identifier."-dropdown-item-".$iid);
96 96
 			$item->setCaption($caption)->setHref($href);
@@ -130,10 +130,11 @@  discard block
 block discarded – undo
130 130
 	 * @see BaseHtml::fromArray()
131 131
 	 */
132 132
 	public function fromArray($array) {
133
-		if (array_keys($array)!==range(0, count($array)-1))
134
-			return parent::fromArray($array);
135
-		else
136
-			return $this->addItems($array);
133
+		if (array_keys($array)!==range(0, count($array)-1)) {
134
+					return parent::fromArray($array);
135
+		} else {
136
+					return $this->addItems($array);
137
+		}
137 138
 	}
138 139
 
139 140
 	public function setItems($items) {
@@ -186,8 +187,9 @@  discard block
 block discarded – undo
186 187
 	 * @see BaseHtml::setTagName()
187 188
 	 */
188 189
 	public function setTagName($tagName) {
189
-		if ($tagName=="button")
190
-			$this->class="btn dropdown-toggle";
190
+		if ($tagName=="button") {
191
+					$this->class="btn dropdown-toggle";
192
+		}
191 193
 		return parent::setTagName($tagName);
192 194
 	}
193 195
 
@@ -205,8 +207,9 @@  discard block
 block discarded – undo
205 207
 	}
206 208
 
207 209
 	public function setAlignment($alignment) {
208
-		if (is_int($alignment))
209
-			$alignment="dropdown-menu-".CssRef::alignment()[$alignment];
210
+		if (is_int($alignment)) {
211
+					$alignment="dropdown-menu-".CssRef::alignment()[$alignment];
212
+		}
210 213
 		return $this->addToMemberCtrl($this->class, $alignment, CssRef::alignment());
211 214
 	}
212 215
 
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPagination.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,10 +52,11 @@  discard block
 block discarded – undo
52 52
 		$this->from=$from;
53 53
 		$this->to=$to;
54 54
 		$this->urlMask="%page%";
55
-		if(!isset($countVisible))
56
-			$this->countVisible=$to-$from+1;
57
-		else
58
-			$this->countVisible=$countVisible;
55
+		if(!isset($countVisible)) {
56
+					$this->countVisible=$to-$from+1;
57
+		} else {
58
+					$this->countVisible=$countVisible;
59
+		}
59 60
 		$this->createContent();
60 61
 	}
61 62
 
@@ -74,7 +75,7 @@  discard block
 block discarded – undo
74 75
 			$href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content);
75 76
 			$href->setProperty($this->attr, $url);
76 77
 			$elem->setContent($href);
77
-		}else{
78
+		} else{
78 79
 			$elem->setContent($content);
79 80
 		}
80 81
 		$this->content[]=$elem;
@@ -107,8 +108,9 @@  discard block
 block discarded – undo
107 108
 	public function _addEvent($event, $jsCode) {
108 109
 		foreach ($this->content as $li){
109 110
 			$content=$li->getContent();
110
-			if($content instanceof BaseHtml)
111
-				$content->_addEvent($event,$jsCode);
111
+			if($content instanceof BaseHtml) {
112
+							$content->_addEvent($event,$jsCode);
113
+			}
112 114
 		}
113 115
 	}
114 116
 	/**
@@ -146,8 +148,9 @@  discard block
 block discarded – undo
146 148
 		if (is_int($size)) {
147 149
 			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
148 150
 		}
149
-		if(!JString::startsWith($size, "pagination-") && $size!=="")
150
-			$size="pagination-".$size;
151
+		if(!JString::startsWith($size, "pagination-") && $size!=="") {
152
+					$size="pagination-".$size;
153
+		}
151 154
 		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
152 155
 	}
153 156
 
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPanel.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
 	 * @return \Ajax\bootstrap\html\HtmlPanel default : "panel-default"
90 90
 	 */
91 91
 	public function setStyle($cssStyle) {
92
-		if (!JString::startsWith($cssStyle, "panel"))
93
-			$cssStyle="panel".$cssStyle;
92
+		if (!JString::startsWith($cssStyle, "panel")) {
93
+					$cssStyle="panel".$cssStyle;
94
+		}
94 95
 		return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel"));
95 96
 	}
96 97
 
@@ -132,7 +133,8 @@  discard block
 block discarded – undo
132 133
 	 * @return $this default : false
133 134
 	 */
134 135
 	public function show($value) {
135
-		if ($this->_collapsable)
136
-			$this->_showOnStartup=$value;
136
+		if ($this->_collapsable) {
137
+					$this->_showOnStartup=$value;
138
+		}
137 139
 	}
138 140
 }
Please login to merge, or discard this patch.
Ajax/common/Widget.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -250,8 +250,9 @@  discard block
 block discarded – undo
250 250
 	 */
251 251
 	public function addItemInToolbar($caption,$icon=NULL,$callback=NULL){
252 252
 		$result=$this->addInToolbar($caption,$callback);
253
-		if(isset($icon) && method_exists($result, "addIcon"))
254
-			$result->addIcon($icon);
253
+		if(isset($icon) && method_exists($result, "addIcon")) {
254
+					$result->addIcon($icon);
255
+		}
255 256
 		return $result;
256 257
 	}
257 258
 
@@ -265,7 +266,7 @@  discard block
 block discarded – undo
265 266
 			foreach ($items as $icon=>$item){
266 267
 				$this->addItemInToolbar($item,$icon,$callback);
267 268
 			}
268
-		}else{
269
+		} else{
269 270
 			foreach ($items as $item){
270 271
 				$this->addItemInToolbar($item,null,$callback);
271 272
 			}
@@ -416,8 +417,9 @@  discard block
 block discarded – undo
416 417
 	protected function _compileForm(){
417 418
 		if(isset($this->_form)){
418 419
 			$noValidate="";
419
-			if(\sizeof($this->_form->getValidationParams())>0)
420
-				$noValidate="novalidate";
420
+			if(\sizeof($this->_form->getValidationParams())>0) {
421
+							$noValidate="novalidate";
422
+			}
421 423
 			$this->wrapContent("<form class='ui form' id='frm-".$this->identifier."' name='frm-".$this->identifier."' ".$noValidate.">","</form>");
422 424
 		}
423 425
 	}
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTableFieldAsTrait.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,15 +63,17 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	private function getFieldButton($caption,$visibleHover=true){
65 65
 		$bt= new HtmlButton($this->cleanIdentifier($caption),$caption);
66
-		if($visibleHover)
67
-			$this->_visibleOver($bt);
66
+		if($visibleHover) {
67
+					$this->_visibleOver($bt);
68
+		}
68 69
 		return $bt;
69 70
 	}
70 71
 
71 72
 	private function getFieldButtons($buttons,$visibleHover=true){
72 73
 		$bts=new HtmlButtonGroups("",$buttons);
73
-		if($visibleHover)
74
-			$this->_visibleOver($bts);
74
+		if($visibleHover) {
75
+					$this->_visibleOver($bts);
76
+		}
75 77
 		return $bts;
76 78
 	}
77 79
 
@@ -88,8 +90,9 @@  discard block
 block discarded – undo
88 90
 		return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$attributes){
89 91
 			$button=new HtmlButton($id,$value,$cssStyle);
90 92
 			$button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]);
91
-			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"])
92
-				$this->_visibleOver($button);
93
+			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) {
94
+							$this->_visibleOver($button);
95
+			}
93 96
 				return $button;
94 97
 		}, $index,$attributes);
95 98
 	}
@@ -160,8 +163,9 @@  discard block
 block discarded – undo
160 163
 	private function getDefaultButton($icon,$class=null,$visibleHover=true){
161 164
 		$bt=$this->getFieldButton("",$visibleHover);
162 165
 		$bt->asIcon($icon);
163
-		if(isset($class))
164
-			$bt->addClass($class);
166
+		if(isset($class)) {
167
+					$bt->addClass($class);
168
+		}
165 169
 		return $bt;
166 170
 	}
167 171
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlMenuItem.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 			if(JArray::isAssociative($content)===false){
18 18
 				$icon=@$content[0];
19 19
 				$title=@$content[1];
20
-			}else{
20
+			} else{
21 21
 				$icon=@$content["icon"];
22 22
 				$title=@$content["title"];
23 23
 			}
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 			if(isset($title)){
28 28
 				$this->setTitle($title);
29 29
 			}
30
-		}else{
30
+		} else{
31 31
 			$this->setContent($content);
32 32
 		}
33 33
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlListgroupItem.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@
 block discarded – undo
40 40
 	 * @return HtmlBsDoubleElement default : "list-group-item-default"
41 41
 	 */
42 42
 	public function setStyle($cssStyle) {
43
-		if (!JString::startsWith($cssStyle, "list-group-item"))
44
-			$cssStyle="list-group-item".$cssStyle;
43
+		if (!JString::startsWith($cssStyle, "list-group-item")) {
44
+					$cssStyle="list-group-item".$cssStyle;
45
+		}
45 46
 		$this->element->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("list-group-item"));
46 47
 		return $this->element;
47 48
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlGrid.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -29,8 +29,9 @@  discard block
 block discarded – undo
29 29
 			$this->_colSizing=false;
30 30
 			$this->setWide($numCols);
31 31
 		}
32
-		if($createCols)
33
-			$this->setRowsCount($numRows, $numCols);
32
+		if($createCols) {
33
+					$this->setRowsCount($numRows, $numCols);
34
+		}
34 35
 	}
35 36
 
36 37
 	public function asSegment() {
@@ -82,8 +83,9 @@  discard block
 block discarded – undo
82 83
 	public function addCol($width=NULL) {
83 84
 		$colCount=$this->colCount() + 1;
84 85
 		$this->setColsCount($colCount, true, $width);
85
-		if ($this->hasOnlyCols($this->count()))
86
-			return $this->content[$colCount - 1];
86
+		if ($this->hasOnlyCols($this->count())) {
87
+					return $this->content[$colCount - 1];
88
+		}
87 89
 		return $this;
88 90
 	}
89 91
 
@@ -178,8 +180,9 @@  discard block
 block discarded – undo
178 180
 	 */
179 181
 	public function rowCount() {
180 182
 		$count=$this->count();
181
-		if ($this->hasOnlyCols($count))
182
-			return 0;
183
+		if ($this->hasOnlyCols($count)) {
184
+					return 0;
185
+		}
183 186
 		return $count;
184 187
 	}
185 188
 
@@ -189,10 +192,12 @@  discard block
 block discarded – undo
189 192
 	 */
190 193
 	public function colCount() {
191 194
 		$count=$this->count();
192
-		if ($this->hasOnlyCols($count))
193
-			return $count;
194
-		if ($count > 0)
195
-			return $this->getItem(0)->count();
195
+		if ($this->hasOnlyCols($count)) {
196
+					return $count;
197
+		}
198
+		if ($count > 0) {
199
+					return $this->getItem(0)->count();
200
+		}
196 201
 		return 0;
197 202
 	}
198 203
 
@@ -203,8 +208,9 @@  discard block
 block discarded – undo
203 208
 	 * @return HtmlGridCol|HtmlGridRow
204 209
 	 */
205 210
 	public function getCell($row, $col) {
206
-		if ($row < 2 && $this->hasOnlyCols($this->count()))
207
-			return $this->getItem($col);
211
+		if ($row < 2 && $this->hasOnlyCols($this->count())) {
212
+					return $this->getItem($col);
213
+		}
208 214
 		$rowO=$this->getItem($row);
209 215
 		if (isset($rowO)) {
210 216
 			$colO=$rowO->getItem($col);
@@ -253,8 +259,9 @@  discard block
 block discarded – undo
253 259
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
254 260
 	 */
255 261
 	public function setPadded($value=NULL) {
256
-		if (isset($value))
257
-			$this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" ));
262
+		if (isset($value)) {
263
+					$this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" ));
264
+		}
258 265
 		return $this->addToProperty("class", "padded");
259 266
 	}
260 267
 
@@ -279,8 +286,9 @@  discard block
 block discarded – undo
279 286
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
280 287
 	 */
281 288
 	protected function createItem($value) {
282
-		if ($this->_createCols === false)
283
-			$value=null;
289
+		if ($this->_createCols === false) {
290
+					$value=null;
291
+		}
284 292
 		$item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows);
285 293
 		return $item;
286 294
 	}
@@ -328,8 +336,9 @@  discard block
 block discarded – undo
328 336
 	 */
329 337
 	public function addDivider($afterColIndex, $vertical=true, $content=NULL) {
330 338
 		$col=$this->getCell(0, $afterColIndex);
331
-		if($col instanceof HtmlGridCol)
332
-			$col->addDivider($vertical, $content);
339
+		if($col instanceof HtmlGridCol) {
340
+					$col->addDivider($vertical, $content);
341
+		}
333 342
 		return $this;
334 343
 	}
335 344
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButtonGroups.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
18 18
 	protected $_dropdown;
19 19
 	public function __construct($identifier, $elements=array(), $asIcons=false) {
20 20
 		parent::__construct($identifier, "div", "ui buttons");
21
-		if ($asIcons === true)
22
-			$this->asIcons();
21
+		if ($asIcons === true) {
22
+					$this->asIcons();
23
+		}
23 24
 		$this->addElements($elements, $asIcons);
24 25
 	}
25 26
 	protected function createItem($value){
@@ -50,8 +51,9 @@  discard block
 block discarded – undo
50 51
 	 */
51 52
 	public function addElement($element, $asIcon=false) {
52 53
 		$item=$this->addItem($element);
53
-		if($asIcon && $item instanceof HtmlButton)
54
-			$item->asIcon($element);
54
+		if($asIcon && $item instanceof HtmlButton) {
55
+					$item->asIcon($element);
56
+		}
55 57
 		return $item;
56 58
 	}
57 59
 
@@ -79,8 +81,9 @@  discard block
 block discarded – undo
79 81
 
80 82
 	public function asIcons() {
81 83
 		foreach ( $this->content as $item ) {
82
-			if($item instanceof HtmlButton)
83
-			$item->asIcon($item->getContent());
84
+			if($item instanceof HtmlButton) {
85
+						$item->asIcon($item->getContent());
86
+			}
84 87
 		}
85 88
 		return $this->addToProperty("class", "icons");
86 89
 	}
@@ -92,8 +95,9 @@  discard block
 block discarded – undo
92 95
 	 */
93 96
 	public function addIcons($icons){
94 97
 		foreach ( $this->content as $index=>$item ) {
95
-			if($item instanceof HtmlButton && isset($icons[$index]))
96
-				$item->addIcon($icons[$index]);
98
+			if($item instanceof HtmlButton && isset($icons[$index])) {
99
+							$item->addIcon($icons[$index]);
100
+			}
97 101
 		}
98 102
 		return $this;
99 103
 	}
Please login to merge, or discard this patch.