Completed
Push — remove_deprecates ( 1de955 )
by Fabio
07:55
created
framework/Web/UI/TControlCollection.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@
 block discarded – undo
63 63
 		{
64 64
 			parent::insertAt($index,$item);
65 65
 			$this->_o->addedControl($item);
66
-		}
67
-		else if(is_string($item) || ($item instanceof IRenderable))
66
+		} else if(is_string($item) || ($item instanceof IRenderable))
68 67
 			parent::insertAt($index,$item);
69 68
 		else
70 69
 			throw new TInvalidDataTypeException('controlcollection_control_required');
Please login to merge, or discard this patch.
framework/Web/UI/TControl.php 1 patch
Braces   +14 added lines, -24 removed lines patch added patch discarded remove patch
@@ -405,11 +405,9 @@  discard block
 block discarded – undo
405 405
 					return $this->_id;
406 406
 				else
407 407
 					return ($this->_uid=$prefix.self::ID_SEPARATOR.$this->_id);
408
-			}
409
-			else	// no naming container
408
+			} else	// no naming container
410 409
 				return $this->_id;
411
-		}
412
-		else
410
+		} else
413 411
 			return $this->_uid;
414 412
 	}
415 413
 
@@ -563,8 +561,7 @@  discard block
 block discarded – undo
563 561
 				if(!$control->getVisible(false))
564 562
 					return false;
565 563
 			return true;
566
-		}
567
-		else
564
+		} else
568 565
 			return $this->getViewState('Visible',true);
569 566
 	}
570 567
 
@@ -594,8 +591,7 @@  discard block
 block discarded – undo
594 591
 				if(!$control->getViewState('Enabled',true))
595 592
 					return false;
596 593
 			return true;
597
-		}
598
-		else
594
+		} else
599 595
 			return $this->getViewState('Enabled',true);
600 596
 	}
601 597
 
@@ -692,8 +688,7 @@  discard block
 block discarded – undo
692 688
 				if($control->_flags & self::IS_DISABLE_VIEWSTATE)
693 689
 					return false;
694 690
 			return true;
695
-		}
696
-		else
691
+		} else
697 692
 			return !($this->_flags & self::IS_DISABLE_VIEWSTATE);
698 693
 	}
699 694
 
@@ -778,8 +773,7 @@  discard block
 block discarded – undo
778 773
 			if(is_object($this->_tempState[$key]) && $this->_trackViewState)
779 774
 				$this->_viewState[$key]=$this->_tempState[$key];
780 775
 			return $this->_tempState[$key];
781
-		}
782
-		else
776
+		} else
783 777
 			return $defaultValue;
784 778
 	}
785 779
 
@@ -799,8 +793,7 @@  discard block
 block discarded – undo
799 793
 		{
800 794
 			unset($this->_tempState[$key]);
801 795
 			$this->_viewState[$key]=$value;
802
-		}
803
-		else
796
+		} else
804 797
 		{
805 798
 			unset($this->_viewState[$key]);
806 799
 			if($value===$defaultValue)
@@ -949,8 +942,7 @@  discard block
 block discarded – undo
949 942
 					$this->createChildControls();
950 943
 				$this->_flags &= ~self::IS_CREATING_CHILD;
951 944
 				$this->_flags |= self::IS_CHILD_CREATED;
952
-			}
953
-			catch(Exception $e)
945
+			} catch(Exception $e)
954 946
 			{
955 947
 				$this->_flags &= ~self::IS_CREATING_CHILD;
956 948
 				$this->_flags |= self::IS_CHILD_CREATED;
@@ -1189,8 +1181,9 @@  discard block
 block discarded – undo
1189 1181
 	final protected function isDescendentOf($ancestor)
1190 1182
 	{
1191 1183
 		$control=$this;
1192
-		while($control!==$ancestor && $control->_parent)
1193
-			$control=$control->_parent;
1184
+		while($control!==$ancestor && $control->_parent) {
1185
+					$control=$control->_parent;
1186
+		}
1194 1187
 		return $control===$ancestor;
1195 1188
 	}
1196 1189
 
@@ -1226,8 +1219,7 @@  discard block
 block discarded – undo
1226 1219
 				{
1227 1220
 					$state=$this->_rf[self::RF_CHILD_STATE][$control->_id];
1228 1221
 					unset($this->_rf[self::RF_CHILD_STATE][$control->_id]);
1229
-				}
1230
-				else
1222
+				} else
1231 1223
 					$state=null;
1232 1224
 				$control->loadStateRecursive($state,!($this->_flags & self::IS_DISABLE_VIEWSTATE));
1233 1225
 				if($this->_stage>=self::CS_LOADED)
@@ -1632,8 +1624,7 @@  discard block
 block discarded – undo
1632 1624
 			{
1633 1625
 				$this->_rf[self::RF_CONTROLSTATE]=&$state[1];
1634 1626
 				unset($state[1]);
1635
-			}
1636
-			else
1627
+			} else
1637 1628
 				unset($this->_rf[self::RF_CONTROLSTATE]);
1638 1629
 			if($needViewState)
1639 1630
 			{
@@ -1710,8 +1701,7 @@  discard block
 block discarded – undo
1710 1701
 		{
1711 1702
 			$page->applyControlStyleSheet($this);
1712 1703
 			$this->_flags |= self::IS_STYLESHEET_APPLIED;
1713
-		}
1714
-		else if($this->_flags & self::IS_STYLESHEET_APPLIED)
1704
+		} else if($this->_flags & self::IS_STYLESHEET_APPLIED)
1715 1705
 			throw new TInvalidOperationException('control_stylesheet_applied',get_class($this));
1716 1706
 	}
1717 1707
 
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActivePageAdapter.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -256,14 +256,12 @@
 block discarded – undo
256 256
 				$param = $this->getCallbackEventParameter();
257 257
 				$result = new TCallbackEventParameter($this->getResponse(), $param);
258 258
 				$callbackHandler->raiseCallbackEvent($result);
259
-			}
260
-			else
259
+			} else
261 260
 			{
262 261
 				throw new TInvalidCallbackException(
263 262
 					'callback_invalid_handler', $callbackHandler->getUniqueID());
264 263
 			}
265
-		 }
266
-		 else
264
+		 } else
267 265
 		 {
268 266
 		 	$target = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_TARGET);
269 267
 		 	throw new TInvalidCallbackException('callback_invalid_target', $target);
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveDataGrid.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,8 +140,7 @@  discard block
 block discarded – undo
140 140
 				$button->setText($text);
141 141
 				return $button;
142 142
 			}
143
-		}
144
-		else {
143
+		} else {
145 144
 			$button=new TActiveButton;
146 145
 			if(!$enabled)
147 146
 				$button->setEnabled(false);
@@ -175,8 +174,7 @@  discard block
 block discarded – undo
175 174
 		if($this->getHasPreRendered()) {
176 175
 			$this->renderDataGrid($writer);
177 176
 			if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer);
178
-		}
179
-		else {
177
+		} else {
180 178
 			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
181 179
 		}
182 180
 	}
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveButtonColumn.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
 				$button->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
52 52
 			$cell->getControls()->add($button);
53 53
 			$cell->registerObject('Button',$button);
54
-		}
55
-		else
54
+		} else
56 55
 			parent::initializeCell($cell,$columnIndex,$itemType);
57 56
 	}
58 57
 }
59 58
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TBaseActiveCallbackControl.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -233,8 +233,7 @@  discard block
 block discarded – undo
233 233
 				$newid=substr($id,$pos+1);
234 234
 				if ($control!==null)
235 235
 					$control=$control->$newid;
236
-			}
237
-			else
236
+			} else
238 237
 			{
239 238
 				// TCheckBoxList overrides findControl() with a fake implementation
240 239
 				// but accepts a second parameter to use the standard one
@@ -296,8 +295,7 @@  discard block
 block discarded – undo
296 295
 		{
297 296
 			$group=$this->getValidationGroup();
298 297
 			return $this->getPage()->getValidators($group)->getCount()>0;
299
-		}
300
-		else
298
+		} else
301 299
 			return false;
302 300
 	}
303 301
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TRepeaterItem.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,8 +129,7 @@
 block discarded – undo
129 129
 		{
130 130
 			$this->raiseBubbleEvent($this,new TRepeaterCommandEventParameter($this,$sender,$param));
131 131
 			return true;
132
-		}
133
-		else
132
+		} else
134 133
 			return false;
135 134
 	}
136 135
 }
137 136
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataGrid.php 1 patch
Braces   +21 added lines, -42 removed lines patch added patch discarded remove patch
@@ -708,33 +708,27 @@  discard block
 block discarded – undo
708 708
 				$this->setSelectedItemIndex($param->getItem()->getItemIndex());
709 709
 				$this->onSelectedIndexChanged($param);
710 710
 				return true;
711
-			}
712
-			else if(strcasecmp($command,self::CMD_EDIT)===0)
711
+			} else if(strcasecmp($command,self::CMD_EDIT)===0)
713 712
 			{
714 713
 				$this->onEditCommand($param);
715 714
 				return true;
716
-			}
717
-			else if(strcasecmp($command,self::CMD_DELETE)===0)
715
+			} else if(strcasecmp($command,self::CMD_DELETE)===0)
718 716
 			{
719 717
 				$this->onDeleteCommand($param);
720 718
 				return true;
721
-			}
722
-			else if(strcasecmp($command,self::CMD_UPDATE)===0)
719
+			} else if(strcasecmp($command,self::CMD_UPDATE)===0)
723 720
 			{
724 721
 				$this->onUpdateCommand($param);
725 722
 				return true;
726
-			}
727
-			else if(strcasecmp($command,self::CMD_CANCEL)===0)
723
+			} else if(strcasecmp($command,self::CMD_CANCEL)===0)
728 724
 			{
729 725
 				$this->onCancelCommand($param);
730 726
 				return true;
731
-			}
732
-			else if(strcasecmp($command,self::CMD_SORT)===0)
727
+			} else if(strcasecmp($command,self::CMD_SORT)===0)
733 728
 			{
734 729
 				$this->onSortCommand(new TDataGridSortCommandEventParameter($sender,$param));
735 730
 				return true;
736
-			}
737
-			else if(strcasecmp($command,self::CMD_PAGE)===0)
731
+			} else if(strcasecmp($command,self::CMD_PAGE)===0)
738 732
 			{
739 733
 				$p=$param->getCommandParameter();
740 734
 				if(strcasecmp($p,self::CMD_PAGE_NEXT)===0)
@@ -881,8 +875,7 @@  discard block
 block discarded – undo
881 875
 			foreach($this->_autoColumns as $column)
882 876
 				$state[]=$column->saveState();
883 877
 			$this->setViewState('AutoColumns',$state,array());
884
-		}
885
-		else
878
+		} else
886 879
 			$this->clearViewState('AutoColumns');
887 880
 		if($this->_columns)
888 881
 		{
@@ -890,8 +883,7 @@  discard block
 block discarded – undo
890 883
 			foreach($this->_columns as $column)
891 884
 				$state[]=$column->saveState();
892 885
 			$this->setViewState('Columns',$state,array());
893
-		}
894
-		else
886
+		} else
895 887
 			$this->clearViewState('Columns');
896 888
 	}
897 889
 
@@ -916,8 +908,7 @@  discard block
 block discarded – undo
916 908
 					$column->loadState($st);
917 909
 					$this->_autoColumns->add($column);
918 910
 				}
919
-			}
920
-			else
911
+			} else
921 912
 				$this->_autoColumns=null;
922 913
 			$state=$this->getViewState('Columns',array());
923 914
 			if($this->_columns && $this->_columns->getCount()===count($state))
@@ -1023,8 +1014,7 @@  discard block
 block discarded – undo
1023 1014
 			$columns=new TList($this->getColumns());
1024 1015
 			$autoColumns=$this->createAutoColumns($data);
1025 1016
 			$columns->mergeWith($autoColumns);
1026
-		}
1027
-		else
1017
+		} else
1028 1018
 			$columns=$this->getColumns();
1029 1019
 		$this->_allColumns=$columns;
1030 1020
 
@@ -1114,8 +1104,7 @@  discard block
 block discarded – undo
1114 1104
 					{
1115 1105
 						$prevCell=$cell;
1116 1106
 						$prevCellText=$cellText;
1117
-					}
1118
-					else
1107
+					} else
1119 1108
 					{
1120 1109
 						if(($rowSpan=$prevCell->getRowSpan())===0)
1121 1110
 							$rowSpan=1;
@@ -1164,8 +1153,7 @@  discard block
 block discarded – undo
1164 1153
 			$this->getControls()->add($item);
1165 1154
 			$item->dataBind();
1166 1155
 			$this->onItemDataBound($param);
1167
-		}
1168
-		else
1156
+		} else
1169 1157
 		{
1170 1158
 			$this->onItemCreated($param);
1171 1159
 			$this->getControls()->add($item);
@@ -1248,8 +1236,7 @@  discard block
 block discarded – undo
1248 1236
 				$button->setText($text);
1249 1237
 				return $button;
1250 1238
 			}
1251
-		}
1252
-		else
1239
+		} else
1253 1240
 		{
1254 1241
 			$button=new TButton;
1255 1242
 			if(!$enabled)
@@ -1283,8 +1270,7 @@  discard block
 block discarded – undo
1283 1270
 
1284 1271
 			$label=$this->createPagerButton($pager,$buttonType,false,$style->getPrevPageText(),'','');
1285 1272
 			$controls->add($label);
1286
-		}
1287
-		else
1273
+		} else
1288 1274
 		{
1289 1275
 			if(($text=$style->getFirstPageText())!=='')
1290 1276
 			{
@@ -1307,8 +1293,7 @@  discard block
 block discarded – undo
1307 1293
 				$label=$this->createPagerButton($pager,$buttonType,false,$text,'','');
1308 1294
 				$controls->add($label);
1309 1295
 			}
1310
-		}
1311
-		else
1296
+		} else
1312 1297
 		{
1313 1298
 			$button=$this->createPagerButton($pager,$buttonType,true,$style->getNextPageText(),self::CMD_PAGE,self::CMD_PAGE_NEXT);
1314 1299
 			$controls->add($button);
@@ -1368,8 +1353,7 @@  discard block
 block discarded – undo
1368 1353
 			{
1369 1354
 				$label=$this->createPagerButton($pager,$buttonType,false,"$i",'','');
1370 1355
 				$controls->add($label);
1371
-			}
1372
-			else
1356
+			} else
1373 1357
 			{
1374 1358
 				$button=$this->createPagerButton($pager,$buttonType,true,"$i",self::CMD_PAGE,"$i");
1375 1359
 				$controls->add($button);
@@ -1415,8 +1399,7 @@  discard block
 block discarded – undo
1415 1399
 					$column->setDataField($key);
1416 1400
 					$column->setSortExpression($key);
1417 1401
 					$autoColumns->add($column);
1418
-				}
1419
-				else
1402
+				} else
1420 1403
 				{
1421 1404
 					$column->setHeaderText(TListItemType::Item);
1422 1405
 					$column->setDataField($key);
@@ -1507,8 +1490,7 @@  discard block
 block discarded – undo
1507 1490
 					{
1508 1491
 						if($itemStyle)
1509 1492
 							$item->getStyle()->mergeWith($itemStyle);
1510
-					}
1511
-					else
1493
+					} else
1512 1494
 					{
1513 1495
 						if($alternatingItemStyle)
1514 1496
 							$item->getStyle()->mergeWith($alternatingItemStyle);
@@ -1521,8 +1503,7 @@  discard block
 block discarded – undo
1521 1503
 					{
1522 1504
 						if($itemStyle)
1523 1505
 							$item->getStyle()->mergeWith($itemStyle);
1524
-					}
1525
-					else
1506
+					} else
1526 1507
 					{
1527 1508
 						if($alternatingItemStyle)
1528 1509
 							$item->getStyle()->mergeWith($alternatingItemStyle);
@@ -1536,8 +1517,7 @@  discard block
 block discarded – undo
1536 1517
 						{
1537 1518
 							if($pagerStyle->getPosition()===TDataGridPagerPosition::Bottom || !$pagerStyle->getVisible())
1538 1519
 								$item->setVisible(false);
1539
-						}
1540
-						else
1520
+						} else
1541 1521
 						{
1542 1522
 							if($pagerStyle->getPosition()===TDataGridPagerPosition::Top || !$pagerStyle->getVisible())
1543 1523
 								$item->setVisible(false);
@@ -1609,8 +1589,7 @@  discard block
 block discarded – undo
1609 1589
 				$control->renderBeginTag($writer);
1610 1590
 				$this->renderContents($writer);
1611 1591
 				$control->renderEndTag($writer);
1612
-			}
1613
-			else if($this->getViewState('ItemCount',0)>0)
1592
+			} else if($this->getViewState('ItemCount',0)>0)
1614 1593
 			{
1615 1594
 				$this->applyItemStyles();
1616 1595
 				if($this->_topPager)
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataBoundControl.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -286,8 +286,7 @@  discard block
 block discarded – undo
286 286
 		{
287 287
 			$this->_requiresDataBinding=true;
288 288
 			$this->ensureDataBound();
289
-		}
290
-		else
289
+		} else
291 290
 			$this->_requiresDataBinding=$value;
292 291
 	}
293 292
 
@@ -350,8 +349,7 @@  discard block
 block discarded – undo
350 349
 					$this->setCurrentPageIndex($ds->getCurrentPageIndex());
351 350
 				}
352 351
 				$this->performDataBinding($ds);
353
-			}
354
-			else
352
+			} else
355 353
 			{
356 354
 				$this->clearViewState('PageCount');
357 355
 				$this->performDataBinding($data);
@@ -380,8 +378,7 @@  discard block
 block discarded – undo
380 378
 				if($this->_currentViewIsFromDataSourceID=$this->getUsingDataSourceID())
381 379
 					$view->attachEventHandler('OnDataSourceViewChanged',array($this,'dataSourceViewChanged'));
382 380
 				$this->_currentView=$view;
383
-			}
384
-			else
381
+			} else
385 382
 				$this->_currentView=null;
386 383
 			$this->_currentViewValid=true;
387 384
 		}
@@ -400,8 +397,7 @@  discard block
 block discarded – undo
400 397
 					throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid',$dsid);
401 398
 				else
402 399
 					$this->_currentDataSource=$dataSource;
403
-			}
404
-			else if(($dataSource=$this->getDataSource())!==null)
400
+			} else if(($dataSource=$this->getDataSource())!==null)
405 401
 				$this->_currentDataSource=new TReadOnlyDataSource($dataSource,$this->getDataMember());
406 402
 			else
407 403
 				$this->_currentDataSource=null;
@@ -482,14 +478,12 @@  discard block
 block discarded – undo
482 478
 					$list->add(array($value,is_string($key)?$key:$value));
483 479
 			}
484 480
 			return $list;
485
-		}
486
-		else if(is_array($value))
481
+		} else if(is_array($value))
487 482
 			return new TMap($value);
488 483
 		else if($value instanceof TDbDataReader) {
489 484
 			// read array from TDbDataReader since it's forward-only stream and can only be traversed once
490 485
 			return $value->readAll();
491
-		}
492
-		else if(($value instanceof \Traversable) || $value===null)
486
+		} else if(($value instanceof \Traversable) || $value===null)
493 487
 			return $value;
494 488
 		else
495 489
 			throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid',get_class($this));
Please login to merge, or discard this patch.