Passed
Branch php-cs-fixer (b9836a)
by Fabio
15:02
created
framework/Web/UI/TPageStateFormatter.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,8 +70,7 @@
 block discarded – undo
70 70
 			{
71 71
 				if(($str = $sm->validateData($str)) !== false)
72 72
 					return unserialize($str);
73
-			}
74
-			else
73
+			} else
75 74
 				return unserialize($str);
76 75
 		}
77 76
 		return null;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TCompareValidator.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,8 +160,7 @@  discard block
 block discarded – undo
160 160
 				throw new TInvalidDataValueException('comparevalidator_controltocompare_invalid');
161 161
 			if(($value2 = $this->getValidationValue($control2)) === '')
162 162
 				return false;
163
-		}
164
-		else
163
+		} else
165 164
 			$value2 = $this->getValueToCompare();
166 165
 
167 166
 		$values = $this->getComparisonValues($value, $value2);
@@ -204,8 +203,7 @@  discard block
 block discarded – undo
204 203
 				{
205 204
 					$formatter = new TSimpleDateFormatter($dateFormat);
206 205
 					return [$formatter->parse($value1), $formatter->parse($value2)];
207
-				}
208
-				else
206
+				} else
209 207
 					return [strtotime($value1), strtotime($value2)];
210 208
 		}
211 209
 		return [$value1, $value2];
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTemplateColumn.php 2 patches
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -198,8 +198,7 @@  discard block
 block discarded – undo
198 198
 					$classPath = $this->getItemRenderer();
199 199
 					$template = $this->_itemTemplate;
200 200
 				}
201
-			}
202
-			else
201
+			} else
203 202
 			{
204 203
 				$template = $this->_itemTemplate;
205 204
 				$classPath = $this->getItemRenderer();
@@ -215,13 +214,11 @@  discard block
 block discarded – undo
215 214
 				}
216 215
 				if($control instanceof \Prado\IDataRenderer)
217 216
 					$control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']);
218
-			}
219
-			elseif($template !== null)
217
+			} elseif($template !== null)
220 218
 				$template->instantiateIn($cell);
221 219
 			elseif($itemType !== TListItemType::EditItem)
222 220
 				$cell->setText(' ');
223
-		}
224
-		elseif($itemType === TListItemType::Header)
221
+		} elseif($itemType === TListItemType::Header)
225 222
 		{
226 223
 			if(($classPath = $this->getHeaderRenderer()) !== '')
227 224
 				$this->initializeHeaderCell($cell, $columnIndex);
@@ -229,8 +226,7 @@  discard block
 block discarded – undo
229 226
 				$this->_headerTemplate->instantiateIn($cell);
230 227
 			else
231 228
 				$this->initializeHeaderCell($cell, $columnIndex);
232
-		}
233
-		elseif($itemType === TListItemType::Footer)
229
+		} elseif($itemType === TListItemType::Footer)
234 230
 		{
235 231
 			if(($classPath = $this->getFooterRenderer()) !== '')
236 232
 				$this->initializeFooterCell($cell, $columnIndex);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@
 block discarded – undo
214 214
 					$control->setItemType($itemType);
215 215
 				}
216 216
 				if($control instanceof \Prado\IDataRenderer)
217
-					$control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']);
217
+					$control->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']);
218 218
 			}
219 219
 			elseif($template !== null)
220 220
 				$template->instantiateIn($cell);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TRangeValidator.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -260,8 +260,7 @@
 block discarded – undo
260 260
 			if($maxValue !== '')
261 261
 				$valid = $valid && $this->isLessThan($value, $formatter->parse($maxValue));
262 262
 			return $valid;
263
-		}
264
-		else
263
+		} else
265 264
 		{
266 265
 			$value = strtotime($value);
267 266
 			if($minValue !== '')
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTabPanel.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -143,15 +143,13 @@  discard block
 block discarded – undo
143 143
 				$activeView = $views->itemAt($index);
144 144
 			else
145 145
 				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id);
146
-		}
147
-		elseif(($index = $this->getActiveViewIndex()) >= 0)
146
+		} elseif(($index = $this->getActiveViewIndex()) >= 0)
148 147
 		{
149 148
 			if($index < $views->getCount())
150 149
 				$activeView = $views->itemAt($index);
151 150
 			else
152 151
 				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index);
153
-		}
154
-		else
152
+		} else
155 153
 		{
156 154
 			foreach($views as $index => $view)
157 155
 			{
@@ -327,8 +325,7 @@  discard block
 block discarded – undo
327 325
 				$this->setActiveViewIndex($index);
328 326
 				$this->setActiveViewID($view->getID(false));
329 327
 				$view->setActive(true);
330
-			}
331
-			else
328
+			} else
332 329
 				$v->setActive(false);
333 330
 		}
334 331
 	}
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	public function getCssClass()
219 219
 	{
220 220
 		$cssClass = parent::getCssClass();
221
-		return $cssClass === ''?'tab-panel':$cssClass;
221
+		return $cssClass === '' ? 'tab-panel' : $cssClass;
222 222
 	}
223 223
 
224 224
 	/**
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	{
345 345
 		if(($index = $values[$this->getClientID() . '_1']) !== null)
346 346
 		{
347
-			$index = (int)$index;
347
+			$index = (int) $index;
348 348
 			$currentIndex = $this->getActiveViewIndex();
349 349
 			if($currentIndex !== $index)
350 350
 			{
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 	public function onPreRender($param)
398 398
 	{
399 399
 		parent::onPreRender($param);
400
-		$this->getActiveView();  // determine the active view
400
+		$this->getActiveView(); // determine the active view
401 401
 		$this->registerStyleSheet();
402 402
 
403 403
 		$page = $this->getPage();
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TEditCommandColumn.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -211,8 +211,7 @@  discard block
 block discarded – undo
211 211
 			$button = $this->createButton('Edit', $this->getEditText(), false, '');
212 212
 			$cell->getControls()->add($button);
213 213
 			$cell->registerObject('EditButton', $button);
214
-		}
215
-		elseif($itemType === TListItemType::EditItem)
214
+		} elseif($itemType === TListItemType::EditItem)
216 215
 		{
217 216
 			$controls = $cell->getControls();
218 217
 			$button = $this->createButton('Update', $this->getUpdateText(), $this->getCausesValidation(), $this->getValidationGroup());
@@ -222,8 +221,7 @@  discard block
 block discarded – undo
222 221
 			$button = $this->createButton('Cancel', $this->getCancelText(), false, '');
223 222
 			$controls->add($button);
224 223
 			$cell->registerObject('CancelButton', $button);
225
-		}
226
-		else
224
+		} else
227 225
 			parent::initializeCell($cell, $columnIndex, $itemType);
228 226
 	}
229 227
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDropDownListColumn.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -271,8 +271,7 @@  discard block
 block discarded – undo
271 271
 					$cell->getControls()->add($listControl);
272 272
 					$cell->registerObject('DropDownList', $listControl);
273 273
 					$control = $listControl;
274
-				}
275
-				else
274
+				} else
276 275
 					$control = $cell;
277 276
 				$control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']);
278 277
 				break;
@@ -308,8 +307,7 @@  discard block
 block discarded – undo
308 307
 				$value = $text;
309 308
 			$formatString = $this->getDataTextFormatString();
310 309
 			$text = $this->formatDataValue($formatString, $text);
311
-		}
312
-		else
310
+		} else
313 311
 			$text = $value;
314 312
 		if($sender instanceof TTableCell)
315 313
 			$sender->setText($text);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -274,13 +274,13 @@
 block discarded – undo
274 274
 				}
275 275
 				else
276 276
 					$control = $cell;
277
-				$control->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']);
277
+				$control->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']);
278 278
 				break;
279 279
 			case TListItemType::Item:
280 280
 			case TListItemType::AlternatingItem:
281 281
 			case TListItemType::SelectedItem:
282 282
 				if($this->getDataTextField() !== '' || $this->getDataValueField() !== '')
283
-					$cell->attachEventHandler('OnDataBinding', [$this,'dataBindColumn']);
283
+					$cell->attachEventHandler('OnDataBinding', [$this, 'dataBindColumn']);
284 284
 				break;
285 285
 			default:
286 286
 				parent::initializeCell($cell, $columnIndex, $itemType);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TPager.php 2 patches
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -404,8 +404,7 @@  discard block
 block discarded – undo
404 404
 			$this->setPageCount($targetControl->getPageCount());
405 405
 			$this->setCurrentPageIndex($targetControl->getCurrentPageIndex());
406 406
 			$this->buildPager();
407
-		}
408
-		else
407
+		} else
409 408
 			$this->_pageCount = 0;
410 409
 	}
411 410
 
@@ -467,15 +466,13 @@  discard block
 block discarded – undo
467 466
 				$button->setCssClass($this->getButtonCssClass());
468 467
 				return $button;
469 468
 			}
470
-		}
471
-		else
469
+		} else
472 470
 		{
473 471
 			if($buttonType === TPagerButtonType::ImageButton)
474 472
 			{
475 473
 				$button = new TImageButton;
476 474
 				$button->setImageUrl($this->getPageImageUrl($text, $commandName));
477
-			}
478
-			else
475
+			} else
479 476
 				$button = new TButton;
480 477
 			if(!$enabled)
481 478
 				$button->setEnabled(false);
@@ -530,8 +527,7 @@  discard block
 block discarded – undo
530 527
 			}
531 528
 			$label = $this->createPagerButton($buttonType, false, $this->getPrevPageText(), self::CMD_PAGE_PREV, '');
532 529
 			$controls->add($label);
533
-		}
534
-		else
530
+		} else
535 531
 		{
536 532
 			if(($text = $this->getFirstPageText()) !== '')
537 533
 			{
@@ -553,8 +549,7 @@  discard block
 block discarded – undo
553 549
 				$label = $this->createPagerButton($buttonType, false, $text, self::CMD_PAGE_LAST, '');
554 550
 				$controls->add($label);
555 551
 			}
556
-		}
557
-		else
552
+		} else
558 553
 		{
559 554
 			$button = $this->createPagerButton($buttonType, true, $this->getNextPageText(), self::CMD_PAGE_NEXT, '');
560 555
 			$controls->add($button);
@@ -612,8 +607,7 @@  discard block
 block discarded – undo
612 607
 			{
613 608
 				$label = $this->createPagerButton($buttonType, false, "$i", self::CMD_PAGE, '');
614 609
 				$controls->add($label);
615
-			}
616
-			else
610
+			} else
617 611
 			{
618 612
 				$button = $this->createPagerButton($buttonType, true, "$i", self::CMD_PAGE, "$i");
619 613
 				$controls->add($button);
@@ -690,32 +684,27 @@  discard block
 block discarded – undo
690 684
 				$pageIndex = TPropertyValue::ensureInteger($param->getCommandParameter()) - 1;
691 685
 				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex));
692 686
 				return true;
693
-			}
694
-			elseif(strcasecmp($command, self::CMD_PAGE_NEXT) === 0)
687
+			} elseif(strcasecmp($command, self::CMD_PAGE_NEXT) === 0)
695 688
 			{
696 689
 				$pageIndex = $this->getCurrentPageIndex() + 1;
697 690
 				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex));
698 691
 				return true;
699
-			}
700
-			elseif(strcasecmp($command, self::CMD_PAGE_PREV) === 0)
692
+			} elseif(strcasecmp($command, self::CMD_PAGE_PREV) === 0)
701 693
 			{
702 694
 				$pageIndex = $this->getCurrentPageIndex() - 1;
703 695
 				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $pageIndex));
704 696
 				return true;
705
-			}
706
-			elseif(strcasecmp($command, self::CMD_PAGE_FIRST) === 0)
697
+			} elseif(strcasecmp($command, self::CMD_PAGE_FIRST) === 0)
707 698
 			{
708 699
 				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, 0));
709 700
 				return true;
710
-			}
711
-			elseif(strcasecmp($command, self::CMD_PAGE_LAST) === 0)
701
+			} elseif(strcasecmp($command, self::CMD_PAGE_LAST) === 0)
712 702
 			{
713 703
 				$this->onPageIndexChanged(new TPagerPageChangedEventParameter($sender, $this->getPageCount() - 1));
714 704
 				return true;
715 705
 			}
716 706
 			return false;
717
-		}
718
-		else
707
+		} else
719 708
 			return false;
720 709
 	}
721 710
 }
722 711
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -577,12 +577,12 @@  discard block
 block discarded – undo
577 577
 		$pageCount = $this->getPageCount();
578 578
 		$pageIndex = $this->getCurrentPageIndex() + 1;
579 579
 		$maxButtonCount = $this->getPageButtonCount();
580
-		$buttonCount = $maxButtonCount > $pageCount?$pageCount:$maxButtonCount;
580
+		$buttonCount = $maxButtonCount > $pageCount ? $pageCount : $maxButtonCount;
581 581
 		$startPageIndex = 1;
582 582
 		$endPageIndex = $buttonCount;
583 583
 		if($pageIndex > $endPageIndex)
584 584
 		{
585
-			$startPageIndex = ((int)(($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1;
585
+			$startPageIndex = ((int) (($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1;
586 586
 			if(($endPageIndex = $startPageIndex + $maxButtonCount - 1) > $pageCount)
587 587
 				$endPageIndex = $pageCount;
588 588
 			if($endPageIndex - $startPageIndex + 1 < $maxButtonCount)
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 			$controls->add("\n");
607 607
 		}
608 608
 
609
-		for($i = $startPageIndex;$i <= $endPageIndex;++$i)
609
+		for($i = $startPageIndex; $i <= $endPageIndex; ++$i)
610 610
 		{
611 611
 			if($i === $pageIndex)
612 612
 			{
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 		$list->dataBind();
649 649
 		$list->setSelectedIndex($this->getCurrentPageIndex());
650 650
 		$list->setAutoPostBack(true);
651
-		$list->attachEventHandler('OnSelectedIndexChanged', [$this,'listIndexChanged']);
651
+		$list->attachEventHandler('OnSelectedIndexChanged', [$this, 'listIndexChanged']);
652 652
 	}
653 653
 
654 654
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TLabel.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,11 +74,9 @@
 block discarded – undo
74 74
 					$this->_forControl = $control->getClientID();
75 75
 					parent::render($writer);
76 76
 				}
77
-			}
78
-			else
77
+			} else
79 78
 				throw new TInvalidDataValueException('label_associatedcontrol_invalid', $aid);
80
-		}
81
-		else
79
+		} else
82 80
 			parent::render($writer);
83 81
 	}
84 82
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 	 */
43 43
 	protected function getTagName()
44 44
 	{
45
-		return ($this->getForControl() === '')?'span':'label';
45
+		return ($this->getForControl() === '') ? 'span' : 'label';
46 46
 	}
47 47
 
48 48
 	/**
Please login to merge, or discard this patch.