Passed
Push — master ( 5c767a...47de24 )
by Jean-Christophe
06:45
created
Ajax/semantic/html/content/table/HtmlTD.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -108,15 +108,17 @@  discard block
 block discarded – undo
108 108
 
109 109
 	public function getColspan() {
110 110
 		$colspan = 1;
111
-		if (\array_key_exists("colspan", $this->properties))
112
-			$colspan = $this->getProperty("colspan");
111
+		if (\array_key_exists("colspan", $this->properties)) {
112
+					$colspan = $this->getProperty("colspan");
113
+		}
113 114
 		return $colspan;
114 115
 	}
115 116
 
116 117
 	public function getRowspan() {
117 118
 		$rowspan = 1;
118
-		if (\array_key_exists("rowspan", $this->properties))
119
-			$rowspan = $this->getProperty("rowspan");
119
+		if (\array_key_exists("rowspan", $this->properties)) {
120
+					$rowspan = $this->getProperty("rowspan");
121
+		}
120 122
 		return $rowspan;
121 123
 	}
122 124
 
@@ -155,7 +157,8 @@  discard block
 block discarded – undo
155 157
 	}
156 158
 
157 159
 	public function compile(JsUtils $js = NULL, &$view = NULL) {
158
-		if (! $this->_deleted)
159
-			return parent::compile($js, $view);
160
+		if (! $this->_deleted) {
161
+					return parent::compile($js, $view);
162
+		}
160 163
 	}
161 164
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 1 patch
Braces   +30 added lines, -20 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	public function __construct($identifier, $tagName = "tbody", $rowCount = NULL, $colCount = NULL) {
34 34
 		parent::__construct($identifier, $tagName, "");
35
-		if (isset($rowCount) && isset($colCount))
36
-			$this->setRowCount($rowCount, $colCount);
35
+		if (isset($rowCount) && isset($colCount)) {
36
+					$this->setRowCount($rowCount, $colCount);
37
+		}
37 38
 	}
38 39
 
39 40
 	/**
@@ -193,10 +194,11 @@  discard block
 block discarded – undo
193 194
 			$values = \array_fill(0, $count, $values);
194 195
 			$isArray = false;
195 196
 		}
196
-		if (JArray::dimension($values) == 1 && $isArray)
197
-			$values = [
197
+		if (JArray::dimension($values) == 1 && $isArray) {
198
+					$values = [
198 199
 				$values
199 200
 			];
201
+		}
200 202
 
201 203
 		$count = \min(\sizeof($values), $count);
202 204
 
@@ -223,8 +225,9 @@  discard block
 block discarded – undo
223 225
 		$count = $this->count();
224 226
 		for ($i = 0; $i < $count; $i ++) {
225 227
 			$cell = $this->getCell($i, $colIndex);
226
-			if ($cell instanceof BaseTrait)
227
-				$cell->addVariations($variations);
228
+			if ($cell instanceof BaseTrait) {
229
+							$cell->addVariations($variations);
230
+			}
228 231
 		}
229 232
 		return $this;
230 233
 	}
@@ -233,8 +236,9 @@  discard block
 block discarded – undo
233 236
 		$count = $this->count();
234 237
 		for ($i = 0; $i < $count; $i ++) {
235 238
 			$cell = $this->getCell($i, $colIndex);
236
-			if (isset($cell))
237
-				$cell->addToProperty($name, $value);
239
+			if (isset($cell)) {
240
+							$cell->addToProperty($name, $value);
241
+			}
238 242
 		}
239 243
 		return $this;
240 244
 	}
@@ -252,8 +256,9 @@  discard block
 block discarded – undo
252 256
 		$count = $this->count();
253 257
 		for ($i = 0; $i < $count; $i ++) {
254 258
 			$index = $this->content[$i]->getColPosition($colIndex);
255
-			if ($index !== NULL)
256
-				$this->getCell($i, $index)->$function();
259
+			if ($index !== NULL) {
260
+							$this->getCell($i, $index)->$function();
261
+			}
257 262
 		}
258 263
 		return $this;
259 264
 	}
@@ -264,8 +269,9 @@  discard block
 block discarded – undo
264 269
 			$maxRow = $this->content[$i]->count();
265 270
 			$index = $maxRow - $colIndex - 1;
266 271
 			if (($cell = $this->getCell($i, $index)) !== NULL) {
267
-				if ($cell->getColspan() == 1)
268
-					$cell->$function();
272
+				if ($cell->getColspan() == 1) {
273
+									$cell->$function();
274
+				}
269 275
 			}
270 276
 		}
271 277
 		return $this;
@@ -311,8 +317,9 @@  discard block
 block discarded – undo
311 317
 	 */
312 318
 	public function getColCount() {
313 319
 		$result = 0;
314
-		if ($this->count() > 0)
315
-			$result = $this->getItem(0)->count();
320
+		if ($this->count() > 0) {
321
+					$result = $this->getItem(0)->count();
322
+		}
316 323
 		return $result;
317 324
 	}
318 325
 
@@ -337,15 +344,17 @@  discard block
 block discarded – undo
337 344
 
338 345
 	public function toDelete($rowIndex, $colIndex) {
339 346
 		$row = $this->getItem($rowIndex);
340
-		if (isset($row) === true)
341
-			$row->toDelete($colIndex);
347
+		if (isset($row) === true) {
348
+					$row->toDelete($colIndex);
349
+		}
342 350
 		return $this;
343 351
 	}
344 352
 
345 353
 	public function toRowspanned($rowIndex, $colIndex) {
346 354
 		$row = $this->getItem($rowIndex);
347
-		if (isset($row) === true)
348
-			$row->toRowspanned($colIndex);
355
+		if (isset($row) === true) {
356
+					$row->toRowspanned($colIndex);
357
+		}
349 358
 		return $this;
350 359
 	}
351 360
 
@@ -455,8 +464,9 @@  discard block
 block discarded – undo
455 464
 		foreach ($rows as $row) {
456 465
 			$cell = $row->getItem($colIndex);
457 466
 			$value = $cell->getContent();
458
-			if ($functionExists)
459
-				$value = \call_user_func($function, $value);
467
+			if ($functionExists) {
468
+							$value = \call_user_func($function, $value);
469
+			}
460 470
 			if ($value !== $identiqual) {
461 471
 				if ($counter > 0 && isset($cellToMerge)) {
462 472
 					$cellToMerge->setRowspanned($counter);
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlGridSystem.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 	public function getRow($index,$force=true){
44 44
 		if($index<sizeof($this->rows)){
45 45
 			$result=$this->rows[$index-1];
46
-		}else if ($force){
46
+		} else if ($force){
47 47
 			$this->setNumRows($index);
48 48
 			$result=$this->rows[$index-1];
49 49
 		}
Please login to merge, or discard this patch.
Ajax/ui/components/Accordion.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@
 block discarded – undo
53 53
 	 * @return $this
54 54
 	 */
55 55
 	public function setAnimate($value) {
56
-		if ($value instanceof Animation)
57
-			$value = $value->getParams();
58
-		else if (is_string($value)) {
56
+		if ($value instanceof Animation) {
57
+					$value = $value->getParams();
58
+		} else if (is_string($value)) {
59 59
 			$animation = new Animation();
60 60
 			$animation->setEasing($value);
61 61
 		}
Please login to merge, or discard this patch.
Ajax/ui/components/DialogButton.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 class DialogButton extends BaseComponent {
15 15
 
16 16
 	private function addFunction($jsCode) {
17
-		if (! JString::startsWith($jsCode, "function"))
18
-			$jsCode = "%function(){" . $jsCode . "}%";
17
+		if (! JString::startsWith($jsCode, "function")) {
18
+					$jsCode = "%function(){" . $jsCode . "}%";
19
+		}
19 20
 		return $jsCode;
20 21
 	}
21 22
 
Please login to merge, or discard this patch.
Ajax/ui/properties/Position.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,8 +84,9 @@
 block discarded – undo
84 84
 	protected function setParamCtrl($key, $value, $typeCtrl) {
85 85
 		if (! $typeCtrl($value)) {
86 86
 			throw new \Exception("La fonction " . $typeCtrl . " a retourné faux pour l'affectation de la propriété " . $key . " à la position");
87
-		} else
88
-			$this->setParam($key, $value);
87
+		} else {
88
+					$this->setParam($key, $value);
89
+		}
89 90
 	}
90 91
 
91 92
 	/*
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemDoubleElement.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -49,8 +49,9 @@  discard block
 block discarded – undo
49 49
 	 * @param string $popupEvent
50 50
 	 */
51 51
 	public function setPopupAttributes($variation = NULL, $popupEvent = NULL) {
52
-		if (isset($this->_popup))
53
-			$this->_popup->setAttributes($variation, $popupEvent);
52
+		if (isset($this->_popup)) {
53
+					$this->_popup->setAttributes($variation, $popupEvent);
54
+		}
54 55
 	}
55 56
 
56 57
 	/**
@@ -109,8 +110,9 @@  discard block
 block discarded – undo
109 110
 		$labelO = $label;
110 111
 		if (\is_object($label) === false) {
111 112
 			$labelO = new HtmlLabel("label-" . $this->identifier, $label);
112
-			if (isset($icon))
113
-				$labelO->addIcon($icon);
113
+			if (isset($icon)) {
114
+							$labelO->addIcon($icon);
115
+			}
114 116
 		} else {
115 117
 			$labelO->addToPropertyCtrl("class", "label", array(
116 118
 				"label"
@@ -141,10 +143,12 @@  discard block
 block discarded – undo
141 143
 	 * @return HtmlSemDoubleElement
142 144
 	 */
143 145
 	public function asLink($href = NULL, $target = NULL) {
144
-		if (isset($href))
145
-			$this->setProperty("href", $href);
146
-		if (isset($target))
147
-			$this->setProperty("target", $target);
146
+		if (isset($href)) {
147
+					$this->setProperty("href", $href);
148
+		}
149
+		if (isset($target)) {
150
+					$this->setProperty("target", $target);
151
+		}
148 152
 		return $this->setTagName("a");
149 153
 	}
150 154
 
@@ -156,8 +160,9 @@  discard block
 block discarded – undo
156 160
 	 */
157 161
 	public function jsShowDimmer($show = true) {
158 162
 		$status = "hide";
159
-		if ($show === true)
160
-			$status = "show";
163
+		if ($show === true) {
164
+					$status = "show";
165
+		}
161 166
 		return '$("#.' . $this->identifier . ').dimmer("' . $status . '");';
162 167
 	}
163 168
 
Please login to merge, or discard this patch.
Ajax/service/AjaxCall.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@
 block discarded – undo
15 15
 	}
16 16
 
17 17
 	public function compile(JsUtils $js = null) {
18
-		if ($js === null)
19
-			return;
18
+		if ($js === null) {
19
+					return;
20
+		}
20 21
 		$params = "{}";
21 22
 		$stopPropagation = true;
22 23
 		$preventDefault = true;
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Braces   +36 added lines, -24 removed lines patch added patch discarded remove patch
@@ -82,16 +82,19 @@  discard block
 block discarded – undo
82 82
 					"stopPropagation" => true
83 83
 				]);
84 84
 			}
85
-			if (\is_array($this->_deleteBehavior))
86
-				$this->_generateBehavior("delete", $this->_deleteBehavior, $js);
87
-			if (\is_array($this->_editBehavior))
88
-				$this->_generateBehavior("edit", $this->_editBehavior, $js);
85
+			if (\is_array($this->_deleteBehavior)) {
86
+							$this->_generateBehavior("delete", $this->_deleteBehavior, $js);
87
+			}
88
+			if (\is_array($this->_editBehavior)) {
89
+							$this->_generateBehavior("edit", $this->_editBehavior, $js);
90
+			}
89 91
 			if (\is_array($this->_displayBehavior)) {
90 92
 				$this->_generateBehavior("display", $this->_displayBehavior, $js);
91 93
 			}
92 94
 			parent::run($js);
93
-			if (isset($this->_pagination))
94
-				$this->_associatePaginationBehavior($js, $offset);
95
+			if (isset($this->_pagination)) {
96
+							$this->_associatePaginationBehavior($js, $offset);
97
+			}
95 98
 			$this->_associateSearchFieldBehavior($js, $offset);
96 99
 			$this->_runned = true;
97 100
 		}
@@ -142,8 +145,9 @@  discard block
 block discarded – undo
142 145
 			$table->setRowCount(0, \sizeof($captions));
143 146
 			$this->_generateHeader($table, $captions);
144 147
 
145
-			if (isset($this->_compileParts))
146
-				$table->setCompileParts($this->_compileParts);
148
+			if (isset($this->_compileParts)) {
149
+							$table->setCompileParts($this->_compileParts);
150
+			}
147 151
 
148 152
 			$this->_generateContent($table);
149 153
 
@@ -178,8 +182,9 @@  discard block
 block discarded – undo
178 182
 	}
179 183
 
180 184
 	protected function _applyStyleAttributes($table) {
181
-		if (isset($this->_hiddenColumns))
182
-			$this->_hideColumns();
185
+		if (isset($this->_hiddenColumns)) {
186
+					$this->_hideColumns();
187
+		}
183 188
 		if (isset($this->_colWidths)) {
184 189
 			foreach ($this->_colWidths as $colIndex => $width) {
185 190
 				$table->setColWidth($colIndex, $width);
@@ -288,8 +293,9 @@  discard block
 block discarded – undo
288 293
 			$field = $ck->getField();
289 294
 			$field->setProperty("value", $dataAjax);
290 295
 			$field->setProperty("name", "selection[]");
291
-			if (isset($checkedClass))
292
-				$field->setClass($checkedClass);
296
+			if (isset($checkedClass)) {
297
+							$field->setClass($checkedClass);
298
+			}
293 299
 			\array_unshift($values, $ck);
294 300
 		}
295 301
 		$result = $table->newRow();
@@ -306,8 +312,9 @@  discard block
 block discarded – undo
306 312
 
307 313
 	protected function _generatePagination($table) {
308 314
 		if (isset($this->_toolbar)) {
309
-			if ($this->_toolbarPosition == PositionInTable::FOOTER)
310
-				$this->_toolbar->setFloated("left");
315
+			if ($this->_toolbarPosition == PositionInTable::FOOTER) {
316
+							$this->_toolbar->setFloated("left");
317
+			}
311 318
 		}
312 319
 		$footer = $table->getFooter();
313 320
 		$footer->mergeCol();
@@ -347,8 +354,9 @@  discard block
 block discarded – undo
347 354
 
348 355
 	protected function _getFieldName($index) {
349 356
 		$fieldName = parent::_getFieldName($index);
350
-		if (\is_object($fieldName))
351
-			$fieldName = "field-" . $index;
357
+		if (\is_object($fieldName)) {
358
+					$fieldName = "field-" . $index;
359
+		}
352 360
 		return $fieldName . "[]";
353 361
 	}
354 362
 
@@ -527,8 +535,9 @@  discard block
 block discarded – undo
527 535
 
528 536
 	protected function getTargetSelector($op) {
529 537
 		$result = $this->_targetSelector;
530
-		if (! isset($result[$op]))
531
-			$result = "#" . $this->identifier;
538
+		if (! isset($result[$op])) {
539
+					$result = "#" . $this->identifier;
540
+		}
532 541
 		return $result[$op];
533 542
 	}
534 543
 
@@ -551,8 +560,9 @@  discard block
 block discarded – undo
551 560
 	}
552 561
 
553 562
 	public function getRefreshSelector() {
554
-		if (isset($this->_refreshSelector))
555
-			return $this->_refreshSelector;
563
+		if (isset($this->_refreshSelector)) {
564
+					return $this->_refreshSelector;
565
+		}
556 566
 		return "#" . $this->identifier . " tbody";
557 567
 	}
558 568
 
@@ -573,8 +583,9 @@  discard block
 block discarded – undo
573 583
 	 */
574 584
 	public function show($modelInstance) {
575 585
 		if (\is_array($modelInstance)) {
576
-			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0]))
577
-				$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
586
+			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) {
587
+							$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
588
+			}
578 589
 		}
579 590
 		$this->_modelInstance = $modelInstance;
580 591
 	}
@@ -616,8 +627,9 @@  discard block
 block discarded – undo
616 627
 	}
617 628
 
618 629
 	public function hideColumn($colIndex) {
619
-		if (! \is_array($this->_hiddenColumns))
620
-			$this->_hiddenColumns = [];
630
+		if (! \is_array($this->_hiddenColumns)) {
631
+					$this->_hiddenColumns = [];
632
+		}
621 633
 		$this->_hiddenColumns[] = $colIndex;
622 634
 		return $this;
623 635
 	}
Please login to merge, or discard this patch.