Completed
Push — prado-3.3 ( f4da81...5dd4b5 )
by Fabio
09:03
created
framework/Web/UI/ActiveControls/TActiveDataGrid.php 1 patch
Braces   +34 added lines, -68 removed lines patch added patch discarded remove patch
@@ -145,8 +145,7 @@  discard block
 block discarded – undo
145 145
 				$button->setText($text);
146 146
 				return $button;
147 147
 			}
148
-		}
149
-		else {
148
+		} else {
150 149
 			$button=new TActiveButton;
151 150
 			if(!$enabled)
152 151
 				$button->setEnabled(false);
@@ -180,8 +179,7 @@  discard block
 block discarded – undo
180 179
 		if($this->getHasPreRendered()) {
181 180
 			$this->renderDataGrid($writer);
182 181
 			if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer);
183
-		}
184
-		else {
182
+		} else {
185 183
 			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
186 184
 		}
187 185
 	}
@@ -248,8 +246,7 @@  discard block
 block discarded – undo
248 246
 				$control->setData($text);
249 247
 			}
250 248
 			$cell->getControls()->add($control);
251
-		}
252
-		else if($this->getAllowSorting()) {
249
+		} else if($this->getAllowSorting()) {
253 250
 				$sortExpression=$this->getSortExpression();
254 251
 				if(($url=$this->getHeaderImageUrl())!=='') {
255 252
 					$button=Prado::createComponent('System.Web.UI.WebControls.TActiveImageButton');
@@ -262,19 +259,16 @@  discard block
 block discarded – undo
262 259
 					}
263 260
 					$button->setCausesValidation(false);
264 261
 					$cell->getControls()->add($button);
265
-				}
266
-				else if($text!=='') {
262
+				} else if($text!=='') {
267 263
 						$button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton');
268 264
 						$button->setText($text);
269 265
 						$button->setCommandName(TDataGrid::CMD_SORT);
270 266
 						$button->setCommandParameter($sortExpression);
271 267
 						$button->setCausesValidation(false);
272 268
 						$cell->getControls()->add($button);
273
-					}
274
-					else
269
+					} else
275 270
 						$cell->setText(' ');
276
-			}
277
-			else {
271
+			} else {
278 272
 				if(($url=$this->getHeaderImageUrl())!=='') {
279 273
 					$image=Prado::createComponent('System.Web.UI.WebControls.TActiveImage');
280 274
 					$image->setImageUrl($url);
@@ -283,8 +277,7 @@  discard block
 block discarded – undo
283 277
 						$image->setToolTip($text);
284 278
 					}
285 279
 					$cell->getControls()->add($image);
286
-				}
287
-				else if($text!=='')
280
+				} else if($text!=='')
288 281
 						$cell->setText($text);
289 282
 					else
290 283
 						$cell->setText(' ');
@@ -376,8 +369,7 @@  discard block
 block discarded – undo
376 369
 				$button->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
377 370
 			$cell->getControls()->add($button);
378 371
 			$cell->registerObject('Button',$button);
379
-		}
380
-		else
372
+		} else
381 373
 			parent::initializeCell($cell,$columnIndex,$itemType);
382 374
 	}
383 375
 }
@@ -416,8 +408,7 @@  discard block
 block discarded – undo
416 408
 				$control->setData($text);
417 409
 			}
418 410
 			$cell->getControls()->add($control);
419
-		}
420
-		else if($this->getAllowSorting()) {
411
+		} else if($this->getAllowSorting()) {
421 412
 				$sortExpression=$this->getSortExpression();
422 413
 				if(($url=$this->getHeaderImageUrl())!=='') {
423 414
 					$button=Prado::createComponent('System.Web.UI.WebControls.TActiveImageButton');
@@ -428,27 +419,23 @@  discard block
 block discarded – undo
428 419
 						$button->setAlternateText($text);
429 420
 					$button->setCausesValidation(false);
430 421
 					$cell->getControls()->add($button);
431
-				}
432
-				else if($text!=='') {
422
+				} else if($text!=='') {
433 423
 						$button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton');
434 424
 						$button->setText($text);
435 425
 						$button->setCommandName(TDataGrid::CMD_SORT);
436 426
 						$button->setCommandParameter($sortExpression);
437 427
 						$button->setCausesValidation(false);
438 428
 						$cell->getControls()->add($button);
439
-					}
440
-					else
429
+					} else
441 430
 						$cell->setText(' ');
442
-			}
443
-			else {
431
+			} else {
444 432
 				if(($url=$this->getHeaderImageUrl())!=='') {
445 433
 					$image=Prado::createComponent('System.Web.UI.WebControls.TActiveImage');
446 434
 					$image->setImageUrl($url);
447 435
 					if($text!=='')
448 436
 						$image->setAlternateText($text);
449 437
 					$cell->getControls()->add($image);
450
-				}
451
-				else if($text!=='')
438
+				} else if($text!=='')
452 439
 						$cell->setText($text);
453 440
 					else
454 441
 						$cell->setText(' ');
@@ -491,8 +478,7 @@  discard block
 block discarded – undo
491 478
 				$control->setData($text);
492 479
 			}
493 480
 			$cell->getControls()->add($control);
494
-		}
495
-		else if($this->getAllowSorting())
481
+		} else if($this->getAllowSorting())
496 482
 		{
497 483
 			$sortExpression=$this->getSortExpression();
498 484
 			if(($url=$this->getHeaderImageUrl())!=='')
@@ -505,8 +491,7 @@  discard block
 block discarded – undo
505 491
 					$button->setAlternateText($text);
506 492
 				$button->setCausesValidation(false);
507 493
 				$cell->getControls()->add($button);
508
-			}
509
-			else if($text!=='')
494
+			} else if($text!=='')
510 495
 			{
511 496
 				$button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton');
512 497
 				$button->setText($text);
@@ -514,11 +499,9 @@  discard block
 block discarded – undo
514 499
 				$button->setCommandParameter($sortExpression);
515 500
 				$button->setCausesValidation(false);
516 501
 				$cell->getControls()->add($button);
517
-			}
518
-			else
502
+			} else
519 503
 				$cell->setText(' ');
520
-		}
521
-		else
504
+		} else
522 505
 		{
523 506
 			if(($url=$this->getHeaderImageUrl())!=='')
524 507
 			{
@@ -527,8 +510,7 @@  discard block
 block discarded – undo
527 510
 				if($text!=='')
528 511
 					$image->setAlternateText($text);
529 512
 				$cell->getControls()->add($image);
530
-			}
531
-			else if($text!=='')
513
+			} else if($text!=='')
532 514
 				$cell->setText($text);
533 515
 			else
534 516
 				$cell->setText(' ');
@@ -574,8 +556,7 @@  discard block
 block discarded – undo
574 556
 			$cell->registerObject('CheckBox',$checkBox);
575 557
 			if($this->getDataField()!=='')
576 558
 				$checkBox->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
577
-		}
578
-		else
559
+		} else
579 560
 			parent::initializeCell($cell,$columnIndex,$itemType);
580 561
 	}
581 562
 
@@ -597,8 +578,7 @@  discard block
 block discarded – undo
597 578
 				$control->setData($text);
598 579
 			}
599 580
 			$cell->getControls()->add($control);
600
-		}
601
-		else if($this->getAllowSorting())
581
+		} else if($this->getAllowSorting())
602 582
 		{
603 583
 			$sortExpression=$this->getSortExpression();
604 584
 			if(($url=$this->getHeaderImageUrl())!=='')
@@ -611,8 +591,7 @@  discard block
 block discarded – undo
611 591
 					$button->setAlternateText($text);
612 592
 				$button->setCausesValidation(false);
613 593
 				$cell->getControls()->add($button);
614
-			}
615
-			else if($text!=='')
594
+			} else if($text!=='')
616 595
 			{
617 596
 				$button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton');
618 597
 				$button->setText($text);
@@ -620,11 +599,9 @@  discard block
 block discarded – undo
620 599
 				$button->setCommandParameter($sortExpression);
621 600
 				$button->setCausesValidation(false);
622 601
 				$cell->getControls()->add($button);
623
-			}
624
-			else
602
+			} else
625 603
 				$cell->setText(' ');
626
-		}
627
-		else
604
+		} else
628 605
 		{
629 606
 			if(($url=$this->getHeaderImageUrl())!=='')
630 607
 			{
@@ -633,8 +610,7 @@  discard block
 block discarded – undo
633 610
 				if($text!=='')
634 611
 					$image->setAlternateText($text);
635 612
 				$cell->getControls()->add($image);
636
-			}
637
-			else if($text!=='')
613
+			} else if($text!=='')
638 614
 				$cell->setText($text);
639 615
 			else
640 616
 				$cell->setText(' ');
@@ -676,8 +652,7 @@  discard block
 block discarded – undo
676 652
 				$control->setData($text);
677 653
 			}
678 654
 			$cell->getControls()->add($control);
679
-		}
680
-		else if($this->getAllowSorting())
655
+		} else if($this->getAllowSorting())
681 656
 		{
682 657
 			$sortExpression=$this->getSortExpression();
683 658
 			if(($url=$this->getHeaderImageUrl())!=='')
@@ -690,8 +665,7 @@  discard block
 block discarded – undo
690 665
 					$button->setAlternateText($text);
691 666
 				$button->setCausesValidation(false);
692 667
 				$cell->getControls()->add($button);
693
-			}
694
-			else if($text!=='')
668
+			} else if($text!=='')
695 669
 			{
696 670
 				$button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton');
697 671
 				$button->setText($text);
@@ -699,11 +673,9 @@  discard block
 block discarded – undo
699 673
 				$button->setCommandParameter($sortExpression);
700 674
 				$button->setCausesValidation(false);
701 675
 				$cell->getControls()->add($button);
702
-			}
703
-			else
676
+			} else
704 677
 				$cell->setText(' ');
705
-		}
706
-		else
678
+		} else
707 679
 		{
708 680
 			if(($url=$this->getHeaderImageUrl())!=='')
709 681
 			{
@@ -712,8 +684,7 @@  discard block
 block discarded – undo
712 684
 				if($text!=='')
713 685
 					$image->setAlternateText($text);
714 686
 				$cell->getControls()->add($image);
715
-			}
716
-			else if($text!=='')
687
+			} else if($text!=='')
717 688
 				$cell->setText($text);
718 689
 			else
719 690
 				$cell->setText(' ');
@@ -759,8 +730,7 @@  discard block
 block discarded – undo
759 730
 				$control->setData($text);
760 731
 			}
761 732
 			$cell->getControls()->add($control);
762
-		}
763
-		else if($this->getAllowSorting()) {
733
+		} else if($this->getAllowSorting()) {
764 734
 				$sortExpression=$this->getSortExpression();
765 735
 				if(($url=$this->getHeaderImageUrl())!=='') {
766 736
 					$button=Prado::createComponent('System.Web.UI.WebControls.TActiveImageButton');
@@ -773,19 +743,16 @@  discard block
 block discarded – undo
773 743
 					}
774 744
 					$button->setCausesValidation(false);
775 745
 					$cell->getControls()->add($button);
776
-				}
777
-				else if($text!=='') {
746
+				} else if($text!=='') {
778 747
 						$button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton');
779 748
 						$button->setText($text);
780 749
 						$button->setCommandName(TDataGrid::CMD_SORT);
781 750
 						$button->setCommandParameter($sortExpression);
782 751
 						$button->setCausesValidation(false);
783 752
 						$cell->getControls()->add($button);
784
-					}
785
-					else
753
+					} else
786 754
 						$cell->setText(' ');
787
-			}
788
-			else {
755
+			} else {
789 756
 				if(($url=$this->getHeaderImageUrl())!=='') {
790 757
 					$image=Prado::createComponent('System.Web.UI.WebControls.TActiveImage');
791 758
 					$image->setImageUrl($url);
@@ -794,8 +761,7 @@  discard block
 block discarded – undo
794 761
 						$image->setToolTip($text);
795 762
 					}
796 763
 					$cell->getControls()->add($image);
797
-				}
798
-				else if($text!=='')
764
+				} else if($text!=='')
799 765
 						$cell->setText($text);
800 766
 					else
801 767
 						$cell->setText(' ');
Please login to merge, or discard this patch.
framework/Web/TAssetManager.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -163,8 +163,7 @@  discard block
 block discarded – undo
163 163
 			if(!is_file($dst.DIRECTORY_SEPARATOR.$fileName) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance)
164 164
 				$this->copyFile($fullpath,$dst);
165 165
 			return $this->_published[$path]=$this->_baseUrl.'/'.$dir.'/'.$fileName;
166
-		}
167
-		else
166
+		} else
168 167
 		{
169 168
 			$dir=$this->hash($fullpath);
170 169
 			if(!is_dir($this->_basePath.DIRECTORY_SEPARATOR.$dir) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance)
@@ -287,8 +286,7 @@  discard block
 block discarded – undo
287 286
 						@copy($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
288 287
 						@chmod($dst.DIRECTORY_SEPARATOR.$file, PRADO_CHMOD);
289 288
 					}
290
-				}
291
-				else
289
+				} else
292 290
 					$this->copyDirectory($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
293 291
 			}
294 292
 			closedir($folder);
Please login to merge, or discard this patch.
framework/Collections/TQueue.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@
 block discarded – undo
81 81
 				$this->_d[]=$item;
82 82
 				++$this->_c;
83 83
 			}
84
-		}
85
-		else if($data!==null)
84
+		} else if($data!==null)
86 85
 			throw new TInvalidDataTypeException('queue_data_not_iterable');
87 86
 	}
88 87
 
Please login to merge, or discard this patch.
requirements/index.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
 		echo "\n\n** PDF file quickstart.pdf created **\n\n";
72 72
 
73
-	}
74
-	else
73
+	} else
75 74
 	{
76 75
 		echo " Unable to find pdfLatex executable $pdflatexExec";
77 76
 	}
Please login to merge, or discard this patch.
bin/prado-cli.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -105,8 +105,7 @@  discard block
 block discarded – undo
105 105
 			{
106 106
 				$valid |= $action->performAction($args);
107 107
 				break;
108
-			}
109
-			else
108
+			} else
110 109
 			{
111 110
 				$valid = false;
112 111
 			}
@@ -207,8 +206,7 @@  discard block
 block discarded – undo
207 206
 			}
208 207
 
209 208
 			return Prado::getApplication();
210
-		}
211
-		else
209
+		} else
212 210
 		{
213 211
 			PradoCommandLineInterpreter::printGreeting();
214 212
 			echo '+'.str_repeat('-',77)."+\n";
@@ -514,8 +512,7 @@  discard block
 block discarded – undo
514 512
 			$running_dir = substr(str_replace(realpath('./'),'',$test_dir),1);
515 513
 			echo 'Running unit tests in directory "'.$running_dir."\":\n";
516 514
 			$test->run(new TextReporter());
517
-		}
518
-		else
515
+		} else
519 516
 		{
520 517
 			$running_dir = substr(str_replace(realpath('./'),'',$dir),1);
521 518
 			echo '** Unable to find test directory "'.$running_dir.'/unit" or "'.$running_dir.'/tests/unit".'."\n";
@@ -669,8 +666,7 @@  discard block
 block discarded – undo
669 666
 			{
670 667
 				echo '** Unable to find table or view "'.$tablename.'" in "'.$manager->getDbConnection()->getConnectionString()."\".\n";
671 668
 				return false;
672
-			}
673
-			else
669
+			} else
674 670
 			{
675 671
 				$properties = array();
676 672
 				foreach($tableInfo->getColumns() as $field=>$column)
@@ -855,8 +851,7 @@  discard block
 block discarded – undo
855 851
 					$args = array($input[0],$input[1], $input[2],$app_dir,'soap');
856 852
 				$cmd = new PradoCommandLineActiveRecordGen;
857 853
 				$cmd->performAction($args);
858
-			}
859
-			else
854
+			} else
860 855
 			{
861 856
 				echo "\n    Usage: generate table_name Application.pages.RecordClassName\n";
862 857
 			}
Please login to merge, or discard this patch.
framework/Web/THttpSession.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -309,13 +309,11 @@  discard block
 block discarded – undo
309 309
       {
310 310
 				ini_set('session.use_cookies','0');
311 311
 			  ini_set('session.use_only_cookies','0');
312
-      }
313
-			else if($value===THttpSessionCookieMode::Allow)
312
+      } else if($value===THttpSessionCookieMode::Allow)
314 313
 			{
315 314
 				ini_set('session.use_cookies','1');
316 315
 				ini_set('session.use_only_cookies','0');
317
-			}
318
-			else
316
+			} else
319 317
 			{
320 318
 				ini_set('session.use_cookies','1');
321 319
 				ini_set('session.use_only_cookies','1');
@@ -368,8 +366,7 @@  discard block
 block discarded – undo
368 366
 			{
369 367
 				ini_set('session.gc_probability',$value);
370 368
 				ini_set('session.gc_divisor','100');
371
-			}
372
-			else
369
+			} else
373 370
 				throw new TInvalidDataValueException('httpsession_gcprobability_invalid',$value);
374 371
 		}
375 372
 	}
@@ -557,8 +554,7 @@  discard block
 block discarded – undo
557 554
 			$value=$_SESSION[$key];
558 555
 			unset($_SESSION[$key]);
559 556
 			return $value;
560
-		}
561
-		else
557
+		} else
562 558
 			return null;
563 559
 	}
564 560
 
Please login to merge, or discard this patch.
framework/Web/Javascripts/TJavaScript.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -171,8 +171,7 @@  discard block
 block discarded – undo
171 171
 					}
172 172
 				}
173 173
 				return '{'.$results.'}';
174
-			}
175
-			else
174
+			} else
176 175
 			{
177 176
 				foreach($value as $v)
178 177
 				{
@@ -185,8 +184,7 @@  discard block
 block discarded – undo
185 184
 				}
186 185
 				return '['.$results.']';
187 186
 			}
188
-		}
189
-		else if(is_integer($value))
187
+		} else if(is_integer($value))
190 188
 			return "$value";
191 189
 		else if(is_float($value))
192 190
 		{
@@ -206,8 +204,7 @@  discard block
 block discarded – undo
206 204
 						return str_replace($locale['decimal_point'], '.', "$value");
207 205
 					break;
208 206
 			}
209
-		}
210
-		else if(is_object($value))
207
+		} else if(is_object($value))
211 208
 			if ($value instanceof TJavaScriptLiteral)
212 209
 				return $value->toJavaScriptLiteral();
213 210
 			else
Please login to merge, or discard this patch.
framework/Web/TUrlManager.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -80,12 +80,10 @@  discard block
 block discarded – undo
80 80
 						$name=urlencode($name.'[]');
81 81
 						foreach($value as $v)
82 82
 							$url.=$amp.$name.'='.urlencode($v);
83
-					}
84
-					else
83
+					} else
85 84
 						$url.=$amp.urlencode($name).'='.urlencode($value);
86 85
 				}
87
-			}
88
-			else
86
+			} else
89 87
 			{
90 88
 				foreach($getItems as $name=>$value)
91 89
 				{
@@ -93,8 +91,7 @@  discard block
 block discarded – undo
93 91
 					{
94 92
 						foreach($value as $v)
95 93
 							$url.=$amp.$name.'[]='.$v;
96
-					}
97
-					else
94
+					} else
98 95
 						$url.=$amp.$name.'='.$value;
99 96
 				}
100 97
 			}
@@ -147,14 +144,12 @@  discard block
 block discarded – undo
147 144
 							$getVariables[substr($name,0,$pos)][]=$value;
148 145
 						else
149 146
 							$getVariables[$name]=$value;
150
-					}
151
-					else
147
+					} else
152 148
 						$getVariables[$path]='';
153 149
 				}
154 150
 			}
155 151
 			return $getVariables;
156
-		}
157
-		else
152
+		} else
158 153
 			return array();
159 154
 	}
160 155
 }
Please login to merge, or discard this patch.
framework/Web/THttpResponse.php 1 patch
Braces   +5 added lines, -9 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		$status=TPropertyValue::ensureInteger($status);
282 282
 		if(isset(self::$HTTP_STATUS_CODES[$status])) {
283 283
 			$this->_reason=self::$HTTP_STATUS_CODES[$status];
284
-		}else{
284
+		} else{
285 285
 			if($reason===null || $reason==='') {
286 286
 				throw new TInvalidDataValueException("response_status_reason_missing");
287 287
 			}
@@ -377,8 +377,7 @@  discard block
 block discarded – undo
377 377
 		{
378 378
 			foreach($headers as $h)
379 379
 				header($h);
380
-		}
381
-		else
380
+		} else
382 381
 		{
383 382
 			header('Pragma: public');
384 383
 			header('Expires: 0');
@@ -488,13 +487,11 @@  discard block
 block discarded – undo
488 487
 				{
489 488
 					$this->_bufferOutput = false;
490 489
 					ob_end_flush();
491
-				}
492
-				else
490
+				} else
493 491
 					ob_flush();
494 492
 				flush();
495 493
 			}
496
-		}
497
-		else
494
+		} else
498 495
 			flush();
499 496
 	}
500 497
 
@@ -645,8 +642,7 @@  discard block
 block discarded – undo
645 642
 				$cookie->getSecure(),
646 643
 				$cookie->getHttpOnly()
647 644
 			);
648
-		}
649
-		else {
645
+		} else {
650 646
 			setcookie(
651 647
 				$cookie->getName(),
652 648
 				$cookie->getValue(),
Please login to merge, or discard this patch.