Passed
Push — master ( 0bebef...727fe8 )
by Jean-Christophe
02:17
created
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Braces   +38 added lines, -26 removed lines patch added patch discarded remove patch
@@ -58,18 +58,21 @@  discard block
 block discarded – undo
58 58
 			$js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]);
59 59
 			$js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]);
60 60
 		}
61
-		if(\is_array($this->_deleteBehavior))
62
-			$this->_generateBehavior("delete",$this->_deleteBehavior, $js);
63
-		if(\is_array($this->_editBehavior))
64
-			$this->_generateBehavior("edit",$this->_editBehavior,$js);
61
+		if(\is_array($this->_deleteBehavior)) {
62
+					$this->_generateBehavior("delete",$this->_deleteBehavior, $js);
63
+		}
64
+		if(\is_array($this->_editBehavior)) {
65
+					$this->_generateBehavior("edit",$this->_editBehavior,$js);
66
+		}
65 67
 		if(\is_array($this->_displayBehavior)){
66 68
 			$this->_displayBehavior["jsCallback"]='$("#dataTable").hide();';
67 69
 			$this->_generateBehavior("display",$this->_displayBehavior,$js);
68 70
 		}
69 71
 		parent::run($js);
70 72
 		$this->_associateSearchFieldBehavior($js,$offset);
71
-		if(isset($this->_pagination))
72
-			$this->_associatePaginationBehavior($js,$offset);
73
+		if(isset($this->_pagination)) {
74
+					$this->_associatePaginationBehavior($js,$offset);
75
+		}
73 76
 	}
74 77
 
75 78
 	protected function _generateBehavior($op,$params,JsUtils $js){
@@ -102,8 +105,9 @@  discard block
 block discarded – undo
102 105
 			$table->setRowCount(0, \sizeof($captions));
103 106
 			$this->_generateHeader($table,$captions);
104 107
 
105
-			if(isset($this->_compileParts))
106
-				$table->setCompileParts($this->_compileParts);
108
+			if(isset($this->_compileParts)) {
109
+							$table->setCompileParts($this->_compileParts);
110
+			}
107 111
 
108 112
 			$this->_generateContent($table);
109 113
 
@@ -133,8 +137,9 @@  discard block
 block discarded – undo
133 137
 	}
134 138
 
135 139
 	protected function _applyStyleAttributes($table){
136
-		if(isset($this->_hiddenColumns))
137
-			$this->_hideColumns();
140
+		if(isset($this->_hiddenColumns)) {
141
+					$this->_hideColumns();
142
+		}
138 143
 			if(isset($this->_colWidths)){
139 144
 				foreach ($this->_colWidths as $colIndex=>$width){
140 145
 					$table->setColWidth($colIndex,$width);
@@ -194,8 +199,9 @@  discard block
 block discarded – undo
194 199
 			$field=$ck->getField();
195 200
 			$field->setProperty("value",$dataAjax);
196 201
 			$field->setProperty("name", "selection[]");
197
-			if(isset($checkedClass))
198
-				$field->setClass($checkedClass);
202
+			if(isset($checkedClass)) {
203
+							$field->setClass($checkedClass);
204
+			}
199 205
 			\array_unshift($values, $ck);
200 206
 		}
201 207
 		$result=$table->newRow();
@@ -209,8 +215,9 @@  discard block
 block discarded – undo
209 215
 
210 216
 	protected function _generatePagination($table){
211 217
 		if(isset($this->_toolbar)){
212
-			if($this->_toolbarPosition==PositionInTable::FOOTER)
213
-				$this->_toolbar->setFloated("left");
218
+			if($this->_toolbarPosition==PositionInTable::FOOTER) {
219
+							$this->_toolbar->setFloated("left");
220
+			}
214 221
 		}
215 222
 		$footer=$table->getFooter();
216 223
 		$footer->mergeCol();
@@ -234,8 +241,9 @@  discard block
 block discarded – undo
234 241
 
235 242
 	protected function _getFieldName($index){
236 243
 		$fieldName=parent::_getFieldName($index);
237
-		if(\is_object($fieldName))
238
-			$fieldName="field-".$index;
244
+		if(\is_object($fieldName)) {
245
+					$fieldName="field-".$index;
246
+		}
239 247
 		return $fieldName."[]";
240 248
 	}
241 249
 
@@ -275,7 +283,7 @@  discard block
 block discarded – undo
275 283
 		$hasPart=$table->hasPart($part);
276 284
 		if($hasPart){
277 285
 			$row=$table->getPart($part)->addRow(\sizeof($captions));
278
-		}else{
286
+		} else{
279 287
 			$row=$table->getPart($part)->getRow(0);
280 288
 		}
281 289
 		$row->mergeCol();
@@ -307,7 +315,7 @@  discard block
 block discarded – undo
307 315
 			$this->_urls["edit"]=JArray::getValue($urls, "edit",1);
308 316
 			$this->_urls["delete"]=JArray::getValue($urls, "delete",2);
309 317
 			$this->_urls["display"]=JArray::getValue($urls, "display",3);
310
-		}else{
318
+		} else{
311 319
 			$this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls,"display"=>$urls];
312 320
 		}
313 321
 		return $this;
@@ -390,8 +398,9 @@  discard block
 block discarded – undo
390 398
 
391 399
 	protected function getTargetSelector($op) {
392 400
 		$result=$this->_targetSelector;
393
-		if(!isset($result[$op]))
394
-			$result="#".$this->identifier;
401
+		if(!isset($result[$op])) {
402
+					$result="#".$this->identifier;
403
+		}
395 404
 		return $result[$op];
396 405
 	}
397 406
 
@@ -409,8 +418,9 @@  discard block
 block discarded – undo
409 418
 	}
410 419
 
411 420
 	public function getRefreshSelector() {
412
-		if(isset($this->_refreshSelector))
413
-			return $this->_refreshSelector;
421
+		if(isset($this->_refreshSelector)) {
422
+					return $this->_refreshSelector;
423
+		}
414 424
 		return "#".$this->identifier." tbody";
415 425
 	}
416 426
 
@@ -429,8 +439,9 @@  discard block
 block discarded – undo
429 439
 	 */
430 440
 	public function show($modelInstance){
431 441
 		if(\is_array($modelInstance)){
432
-			if(isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0]))
433
-				$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
442
+			if(isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) {
443
+							$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
444
+			}
434 445
 		}
435 446
 		$this->_modelInstance=$modelInstance;
436 447
 	}
@@ -470,8 +481,9 @@  discard block
 block discarded – undo
470 481
 	}
471 482
 
472 483
 	public function hideColumn($colIndex){
473
-		if(!\is_array($this->_hiddenColumns))
474
-			$this->_hiddenColumns=[];
484
+		if(!\is_array($this->_hiddenColumns)) {
485
+					$this->_hiddenColumns=[];
486
+		}
475 487
 		$this->_hiddenColumns[]=$colIndex;
476 488
 		return $this;
477 489
 	}
Please login to merge, or discard this patch.
Ajax/common/html/HtmlCollection.php 1 patch
Braces   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 			foreach ($items as $k=>$v){
25 25
 				$this->addItem([$k,$v]);
26 26
 			}
27
-		}else{
27
+		} else{
28 28
 			foreach ($items as $item){
29 29
 				$this->addItem($item);
30 30
 			}
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 	 * @return \Ajax\common\html\HtmlDoubleElement
81 81
 	 */
82 82
 	public function getItem($index) {
83
-		if (is_int($index)&& isset($this->content[$index]))
84
-			return $this->content[$index];
85
-		else {
83
+		if (is_int($index)&& isset($this->content[$index])) {
84
+					return $this->content[$index];
85
+		} else {
86 86
 			$elm=$this->getElementById($index, $this->content);
87 87
 			return $elm;
88 88
 		}
@@ -144,10 +144,11 @@  discard block
 block discarded – undo
144 144
 		$i=0;
145 145
 		foreach ($properties as $k=>$v){
146 146
 			$c=$this->content[$i++];
147
-			if(isset($c))
148
-				$c->setProperty($k,$v);
149
-			else
150
-				return $this;
147
+			if(isset($c)) {
148
+							$c->setProperty($k,$v);
149
+			} else {
150
+							return $this;
151
+			}
151 152
 		}
152 153
 		return $this;
153 154
 	}
@@ -165,8 +166,7 @@  discard block
 block discarded – undo
165 166
 		foreach ($values as $i=>$value){
166 167
 			if(isset($this->content[$i])){
167 168
 				$this->content[$i]->setProperty($property,$value);
168
-			}
169
-			else{
169
+			} else{
170 170
 				return $this;
171 171
 			}
172 172
 		}
@@ -186,8 +186,7 @@  discard block
 block discarded – undo
186 186
 		foreach ($values as $i=>$value){
187 187
 			if(isset($this->content[$i])){
188 188
 				$this->content[$i++]->addToProperty($property,$value);
189
-			}
190
-			else{
189
+			} else{
191 190
 				return $this;
192 191
 			}
193 192
 		}
@@ -216,8 +215,9 @@  discard block
 block discarded – undo
216 215
 		foreach ( $this->content as $index=>$item ) {
217 216
 			if($item instanceof HtmlDoubleElement){
218 217
 				$href="";
219
-				if(isset($hrefs[$index]))
220
-					$href=$hrefs[$index];
218
+				if(isset($hrefs[$index])) {
219
+									$href=$hrefs[$index];
220
+				}
221 221
 				$item->asLink($href,$target);
222 222
 			}
223 223
 		}
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	public function getProperty($name) {
36
-		if (array_key_exists($name, $this->_self->properties))
37
-			return $this->_self->properties[$name];
36
+		if (array_key_exists($name, $this->_self->properties)) {
37
+					return $this->_self->properties[$name];
38
+		}
38 39
 	}
39 40
 
40 41
 	/**
@@ -76,8 +77,9 @@  discard block
 block discarded – undo
76 77
 	}
77 78
 
78 79
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
79
-		if (is_string($typeCtrl) && @class_exists($typeCtrl, true))
80
-			$typeCtrl=$typeCtrl::getConstants();
80
+		if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) {
81
+					$typeCtrl=$typeCtrl::getConstants();
82
+		}
81 83
 			if (\is_array($typeCtrl)) {
82 84
 				$this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl);
83 85
 			}
@@ -96,8 +98,9 @@  discard block
 block discarded – undo
96 98
 	}
97 99
 
98 100
 	public function removeProperty($name) {
99
-		if (\array_key_exists($name, $this->_self->properties))
100
-			unset($this->_self->properties[$name]);
101
+		if (\array_key_exists($name, $this->_self->properties)) {
102
+					unset($this->_self->properties[$name]);
103
+		}
101 104
 			return $this;
102 105
 	}
103 106
 
@@ -110,8 +113,9 @@  discard block
 block discarded – undo
110 113
 	}
111 114
 
112 115
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
113
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true)
114
-			return $this->_self->setProperty($name, $value);
116
+		if ($this->_self->ctrl($name, $value, $typeCtrl) === true) {
117
+					return $this->_self->setProperty($name, $value);
118
+		}
115 119
 			return $this;
116 120
 	}
117 121
 
Please login to merge, or discard this patch.