Passed
Push — master ( 1a87e3...34d65d )
by Jean-Christophe
03:35
created
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Braces   +33 added lines, -22 removed lines patch added patch discarded remove patch
@@ -89,10 +89,12 @@  discard block
 block discarded – undo
89 89
 					"stopPropagation" => true
90 90
 				]);
91 91
 			}
92
-			if (\is_array($this->_deleteBehavior))
93
-				$this->_generateBehavior("delete", $this->_deleteBehavior, $js);
94
-			if (\is_array($this->_editBehavior))
95
-				$this->_generateBehavior("edit", $this->_editBehavior, $js);
92
+			if (\is_array($this->_deleteBehavior)) {
93
+							$this->_generateBehavior("delete", $this->_deleteBehavior, $js);
94
+			}
95
+			if (\is_array($this->_editBehavior)) {
96
+							$this->_generateBehavior("edit", $this->_editBehavior, $js);
97
+			}
96 98
 			if (\is_array($this->_displayBehavior)) {
97 99
 				$this->_generateBehavior("display", $this->_displayBehavior, $js);
98 100
 			}
@@ -150,8 +152,9 @@  discard block
 block discarded – undo
150 152
 			$table->setRowCount(0, \count($captions));
151 153
 			$this->_generateHeader($table, $captions);
152 154
 
153
-			if (isset($this->_compileParts))
154
-				$table->setCompileParts($this->_compileParts);
155
+			if (isset($this->_compileParts)) {
156
+							$table->setCompileParts($this->_compileParts);
157
+			}
155 158
 
156 159
 			$this->_generateContent($table);
157 160
 
@@ -189,8 +192,9 @@  discard block
 block discarded – undo
189 192
 	}
190 193
 
191 194
 	protected function _applyStyleAttributes($table) {
192
-		if (isset($this->_hiddenColumns))
193
-			$this->_hideColumns();
195
+		if (isset($this->_hiddenColumns)) {
196
+					$this->_hideColumns();
197
+		}
194 198
 		if (isset($this->_colWidths)) {
195 199
 			foreach ($this->_colWidths as $colIndex => $width) {
196 200
 				$table->setColWidth($colIndex, $width);
@@ -303,8 +307,9 @@  discard block
 block discarded – undo
303 307
 			$field = $ck->getField();
304 308
 			$field->setProperty("value", $dataAjax);
305 309
 			$field->setProperty("name", "selection[]");
306
-			if (isset($checkedClass))
307
-				$field->setClass($checkedClass);
310
+			if (isset($checkedClass)) {
311
+							$field->setClass($checkedClass);
312
+			}
308 313
 			\array_unshift($values, $ck);
309 314
 		}
310 315
 		$result = $table->newRow();
@@ -321,8 +326,9 @@  discard block
 block discarded – undo
321 326
 
322 327
 	protected function _generatePagination($table) {
323 328
 		if (isset($this->_toolbar)) {
324
-			if ($this->_toolbarPosition == PositionInTable::FOOTER)
325
-				$this->_toolbar->setFloated("left");
329
+			if ($this->_toolbarPosition == PositionInTable::FOOTER) {
330
+							$this->_toolbar->setFloated("left");
331
+			}
326 332
 		}
327 333
 		$footer = $table->getFooter();
328 334
 		$footer->mergeCol();
@@ -364,8 +370,9 @@  discard block
 block discarded – undo
364 370
 
365 371
 	protected function _getFieldName($index) {
366 372
 		$fieldName = parent::_getFieldName($index);
367
-		if (\is_object($fieldName))
368
-			$fieldName = "field-" . $index;
373
+		if (\is_object($fieldName)) {
374
+					$fieldName = "field-" . $index;
375
+		}
369 376
 		if ($this->_namePrefix != null) {
370 377
 			$fieldName = $this->_namePrefix . '.' . $fieldName;
371 378
 		}
@@ -557,8 +564,9 @@  discard block
 block discarded – undo
557 564
 
558 565
 	protected function getTargetSelector($op) {
559 566
 		$result = $this->_targetSelector;
560
-		if (! isset($result[$op]))
561
-			$result = "#" . $this->identifier;
567
+		if (! isset($result[$op])) {
568
+					$result = "#" . $this->identifier;
569
+		}
562 570
 		return $result[$op];
563 571
 	}
564 572
 
@@ -581,8 +589,9 @@  discard block
 block discarded – undo
581 589
 	}
582 590
 
583 591
 	public function getRefreshSelector() {
584
-		if (isset($this->_refreshSelector))
585
-			return $this->_refreshSelector;
592
+		if (isset($this->_refreshSelector)) {
593
+					return $this->_refreshSelector;
594
+		}
586 595
 		return "#" . $this->identifier . " tbody";
587 596
 	}
588 597
 
@@ -603,8 +612,9 @@  discard block
 block discarded – undo
603 612
 	 */
604 613
 	public function show($modelInstance) {
605 614
 		if (\is_array($modelInstance)) {
606
-			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0]))
607
-				$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
615
+			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) {
616
+							$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
617
+			}
608 618
 		}
609 619
 		$this->_modelInstance = $modelInstance;
610 620
 	}
@@ -654,8 +664,9 @@  discard block
 block discarded – undo
654 664
 	}
655 665
 
656 666
 	public function hideColumn($colIndex) {
657
-		if (! \is_array($this->_hiddenColumns))
658
-			$this->_hiddenColumns = [];
667
+		if (! \is_array($this->_hiddenColumns)) {
668
+					$this->_hiddenColumns = [];
669
+		}
659 670
 		$this->_hiddenColumns[] = $colIndex;
660 671
 		return $this;
661 672
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/HtmlTable.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -444,8 +444,9 @@  discard block
 block discarded – undo
444 444
 			$result = $this->getBody()->_addRow($result);
445 445
 		}
446 446
 		if (isset($this->_afterCompileEvents["onNewRow"])) {
447
-			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
448
-				$this->_afterCompileEvents["onNewRow"]($result, $object);
447
+			if (\is_callable($this->_afterCompileEvents["onNewRow"])) {
448
+							$this->_afterCompileEvents["onNewRow"]($result, $object);
449
+			}
449 450
 		}
450 451
 		return $result;
451 452
 	}
@@ -483,8 +484,9 @@  discard block
 block discarded – undo
483 484
 			}
484 485
 		}
485 486
 		$result = parent::run($js);
486
-		if (isset($this->_footer))
487
-			$this->_footer->run($js);
487
+		if (isset($this->_footer)) {
488
+					$this->_footer->run($js);
489
+		}
488 490
 		$this->_runned = true;
489 491
 		return $result;
490 492
 	}
@@ -538,8 +540,9 @@  discard block
 block discarded – undo
538 540
 
539 541
 	public function setColWidth($colIndex, $width) {
540 542
 		$part = $this->_getFirstPart();
541
-		if ($part !== null && $part->count() > 0)
542
-			$part->getCell(0, $colIndex)->setWidth($width);
543
+		if ($part !== null && $part->count() > 0) {
544
+					$part->getCell(0, $colIndex)->setWidth($width);
545
+		}
543 546
 		return $this;
544 547
 	}
545 548
 
Please login to merge, or discard this patch.