Passed
Push — master ( a7566d...3c4d03 )
by Jean-Christophe
02:23
created
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Braces   +36 added lines, -24 removed lines patch added patch discarded remove patch
@@ -86,16 +86,19 @@  discard block
 block discarded – undo
86 86
 					"stopPropagation" => true
87 87
 				]);
88 88
 			}
89
-			if (\is_array($this->_deleteBehavior))
90
-				$this->_generateBehavior("delete", $this->_deleteBehavior, $js);
91
-			if (\is_array($this->_editBehavior))
92
-				$this->_generateBehavior("edit", $this->_editBehavior, $js);
89
+			if (\is_array($this->_deleteBehavior)) {
90
+							$this->_generateBehavior("delete", $this->_deleteBehavior, $js);
91
+			}
92
+			if (\is_array($this->_editBehavior)) {
93
+							$this->_generateBehavior("edit", $this->_editBehavior, $js);
94
+			}
93 95
 			if (\is_array($this->_displayBehavior)) {
94 96
 				$this->_generateBehavior("display", $this->_displayBehavior, $js);
95 97
 			}
96 98
 			parent::run($js);
97
-			if (isset($this->_pagination))
98
-				$this->_associatePaginationBehavior($js, $offset);
99
+			if (isset($this->_pagination)) {
100
+							$this->_associatePaginationBehavior($js, $offset);
101
+			}
99 102
 			$this->_associateSearchFieldBehavior($js, $offset);
100 103
 			$this->_runned = true;
101 104
 		}
@@ -146,8 +149,9 @@  discard block
 block discarded – undo
146 149
 			$table->setRowCount(0, \count($captions));
147 150
 			$this->_generateHeader($table, $captions);
148 151
 
149
-			if (isset($this->_compileParts))
150
-				$table->setCompileParts($this->_compileParts);
152
+			if (isset($this->_compileParts)) {
153
+							$table->setCompileParts($this->_compileParts);
154
+			}
151 155
 
152 156
 			$this->_generateContent($table);
153 157
 
@@ -182,8 +186,9 @@  discard block
 block discarded – undo
182 186
 	}
183 187
 
184 188
 	protected function _applyStyleAttributes($table) {
185
-		if (isset($this->_hiddenColumns))
186
-			$this->_hideColumns();
189
+		if (isset($this->_hiddenColumns)) {
190
+					$this->_hideColumns();
191
+		}
187 192
 		if (isset($this->_colWidths)) {
188 193
 			foreach ($this->_colWidths as $colIndex => $width) {
189 194
 				$table->setColWidth($colIndex, $width);
@@ -296,8 +301,9 @@  discard block
 block discarded – undo
296 301
 			$field = $ck->getField();
297 302
 			$field->setProperty("value", $dataAjax);
298 303
 			$field->setProperty("name", "selection[]");
299
-			if (isset($checkedClass))
300
-				$field->setClass($checkedClass);
304
+			if (isset($checkedClass)) {
305
+							$field->setClass($checkedClass);
306
+			}
301 307
 			\array_unshift($values, $ck);
302 308
 		}
303 309
 		$result = $table->newRow();
@@ -314,8 +320,9 @@  discard block
 block discarded – undo
314 320
 
315 321
 	protected function _generatePagination($table) {
316 322
 		if (isset($this->_toolbar)) {
317
-			if ($this->_toolbarPosition == PositionInTable::FOOTER)
318
-				$this->_toolbar->setFloated("left");
323
+			if ($this->_toolbarPosition == PositionInTable::FOOTER) {
324
+							$this->_toolbar->setFloated("left");
325
+			}
319 326
 		}
320 327
 		$footer = $table->getFooter();
321 328
 		$footer->mergeCol();
@@ -356,8 +363,9 @@  discard block
 block discarded – undo
356 363
 
357 364
 	protected function _getFieldName($index) {
358 365
 		$fieldName = parent::_getFieldName($index);
359
-		if (\is_object($fieldName))
360
-			$fieldName = "field-" . $index;
366
+		if (\is_object($fieldName)) {
367
+					$fieldName = "field-" . $index;
368
+		}
361 369
 		return $fieldName . "[]";
362 370
 	}
363 371
 
@@ -546,8 +554,9 @@  discard block
 block discarded – undo
546 554
 
547 555
 	protected function getTargetSelector($op) {
548 556
 		$result = $this->_targetSelector;
549
-		if (! isset($result[$op]))
550
-			$result = "#" . $this->identifier;
557
+		if (! isset($result[$op])) {
558
+					$result = "#" . $this->identifier;
559
+		}
551 560
 		return $result[$op];
552 561
 	}
553 562
 
@@ -570,8 +579,9 @@  discard block
 block discarded – undo
570 579
 	}
571 580
 
572 581
 	public function getRefreshSelector() {
573
-		if (isset($this->_refreshSelector))
574
-			return $this->_refreshSelector;
582
+		if (isset($this->_refreshSelector)) {
583
+					return $this->_refreshSelector;
584
+		}
575 585
 		return "#" . $this->identifier . " tbody";
576 586
 	}
577 587
 
@@ -592,8 +602,9 @@  discard block
 block discarded – undo
592 602
 	 */
593 603
 	public function show($modelInstance) {
594 604
 		if (\is_array($modelInstance)) {
595
-			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0]))
596
-				$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
605
+			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) {
606
+							$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
607
+			}
597 608
 		}
598 609
 		$this->_modelInstance = $modelInstance;
599 610
 	}
@@ -639,8 +650,9 @@  discard block
 block discarded – undo
639 650
 	}
640 651
 
641 652
 	public function hideColumn($colIndex) {
642
-		if (! \is_array($this->_hiddenColumns))
643
-			$this->_hiddenColumns = [];
653
+		if (! \is_array($this->_hiddenColumns)) {
654
+					$this->_hiddenColumns = [];
655
+		}
644 656
 		$this->_hiddenColumns[] = $colIndex;
645 657
 		return $this;
646 658
 	}
Please login to merge, or discard this patch.