Completed
Branch scrutinizer (4d54e2)
by Fabio
11:55
created
framework/Util/TBehavior.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TBehavior class file.
4
- *
5
- * @author Qiang Xue <[email protected]>
6
- * @link http://www.yiiframework.com/
7
- * @copyright Copyright &copy; 2008-2009 Yii Software LLC
8
- * @license http://www.yiiframework.com/license/
9
- */
3
+	 * TBehavior class file.
4
+	 *
5
+	 * @author Qiang Xue <[email protected]>
6
+	 * @link http://www.yiiframework.com/
7
+	 * @copyright Copyright &copy; 2008-2009 Yii Software LLC
8
+	 * @license http://www.yiiframework.com/license/
9
+	 */
10 10
 
11 11
 /**
12 12
  * TBehavior is a convenient base class for behavior classes.
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	{
44 44
 		$this->_owner=$owner;
45 45
 		foreach($this->events() as $event=>$handler)
46
-			$owner->attachEventHandler($event,array($this,$handler));
46
+			$owner->attachEventHandler($event, array($this, $handler));
47 47
 	}
48 48
 
49 49
 	/**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	public function detach($owner)
57 57
 	{
58 58
 		foreach($this->events() as $event=>$handler)
59
-			$owner->detachEventHandler($event,array($this,$handler));
59
+			$owner->detachEventHandler($event, array($this, $handler));
60 60
 		$this->_owner=null;
61 61
 	}
62 62
 
Please login to merge, or discard this patch.
framework/Data/ActiveRecord/TActiveRecord.php 4 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TActiveRecord, TActiveRecordEventParameter, TActiveRecordInvalidFinderResult class file.
4
- *
5
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.Data.ActiveRecord
10
- */
3
+	 * TActiveRecord, TActiveRecordEventParameter, TActiveRecordInvalidFinderResult class file.
4
+	 *
5
+	 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.Data.ActiveRecord
10
+	 */
11 11
 
12 12
 /**
13 13
  * Load record manager, criteria and relations.
@@ -1026,28 +1026,28 @@  discard block
 block discarded – undo
1026 1026
 		return isset(self::$_relations[get_class($this)][strtolower($property)]);
1027 1027
 	}
1028 1028
 	
1029
-        /**
1030
-        * Return record data as array
1031
-        * @return array of column name and column values
1032
-        * @since 3.2.4
1033
-        */
1034
-        public function toArray(){
1035
-        	$result=array();
1036
-        	foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName){
1037
-            		$result[$columnName]=$this->getColumnValue($columnName);
1038
-           	}
1029
+		/**
1030
+		 * Return record data as array
1031
+		 * @return array of column name and column values
1032
+		 * @since 3.2.4
1033
+		 */
1034
+		public function toArray(){
1035
+			$result=array();
1036
+			foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName){
1037
+					$result[$columnName]=$this->getColumnValue($columnName);
1038
+		   	}
1039 1039
         
1040
-        	return $result;
1041
-    	}
1040
+			return $result;
1041
+		}
1042 1042
     
1043
-    	/**
1044
-     	* Return record data as JSON
1045
-     	* @return JSON
1046
-     	* @since 3.2.4
1047
-     	*/
1048
-    	public function toJSON(){
1049
-        	return json_encode($this->toArray());
1050
-    	}
1043
+		/**
1044
+		 * Return record data as JSON
1045
+		 * @return JSON
1046
+		 * @since 3.2.4
1047
+		 */
1048
+		public function toJSON(){
1049
+			return json_encode($this->toArray());
1050
+		}
1051 1051
 }
1052 1052
 
1053 1053
 /**
Please login to merge, or discard this patch.
Doc Comments   +9 added lines, -1 removed lines patch added patch discarded remove patch
@@ -505,6 +505,7 @@  discard block
 block discarded – undo
505 505
 	 * Delete multiple records using a criteria.
506 506
 	 * @param string|TActiveRecordCriteria SQL condition or criteria object.
507 507
 	 * @param mixed parameter values.
508
+	 * @param TActiveRecordCriteria $criteria
508 509
 	 * @return int number of records deleted.
509 510
 	 */
510 511
 	public function deleteAll($criteria=null, $parameters=array())
@@ -571,6 +572,7 @@  discard block
 block discarded – undo
571 572
 	 *
572 573
 	 * @param string|TActiveRecordCriteria SQL condition or criteria object.
573 574
 	 * @param mixed parameter values.
575
+	 * @param TActiveRecordCriteria $criteria
574 576
 	 * @return TActiveRecord matching record object. Null if no result is found.
575 577
 	 */
576 578
 	public function find($criteria,$parameters=array())
@@ -587,6 +589,7 @@  discard block
 block discarded – undo
587 589
 	 *
588 590
 	 * @param string|TActiveRecordCriteria SQL condition or criteria object.
589 591
 	 * @param mixed parameter values.
592
+	 * @param TActiveRecordCriteria $criteria
590 593
 	 * @return array matching record objects. Empty array if no result is found.
591 594
 	 */
592 595
 	public function findAll($criteria=null,$parameters=array())
@@ -700,6 +703,7 @@  discard block
 block discarded – undo
700 703
 	 * Find the number of records.
701 704
 	 * @param string|TActiveRecordCriteria SQL condition or criteria object.
702 705
 	 * @param mixed parameter values.
706
+	 * @param TActiveRecordCriteria $criteria
703 707
 	 * @return int number of records.
704 708
 	 */
705 709
 	public function count($criteria=null,$parameters=array())
@@ -715,6 +719,7 @@  discard block
 block discarded – undo
715 719
 	 * value equal to the $property value.
716 720
 	 * @param string relationship/property name corresponding to keys in $RELATION array.
717 721
 	 * @param array method call arguments.
722
+	 * @param string $name
718 723
 	 * @return TActiveRecordRelation, null if the context or the handler doesn't exist
719 724
 	 */
720 725
 	protected function getRelationHandler($name,$args=array())
@@ -939,6 +944,7 @@  discard block
 block discarded – undo
939 944
 	 * Raised before the record attempt to insert its data into the database.
940 945
 	 * To prevent the insert operation, set the TActiveRecordChangeEventParameter::IsValid parameter to false.
941 946
 	 * @param TActiveRecordChangeEventParameter event parameter to be passed to the event handlers
947
+	 * @param TActiveRecordChangeEventParameter $param
942 948
 	 */
943 949
 	public function onInsert($param)
944 950
 	{
@@ -949,6 +955,7 @@  discard block
 block discarded – undo
949 955
 	 * Raised before the record attempt to delete its data from the database.
950 956
 	 * To prevent the delete operation, set the TActiveRecordChangeEventParameter::IsValid parameter to false.
951 957
 	 * @param TActiveRecordChangeEventParameter event parameter to be passed to the event handlers
958
+	 * @param TActiveRecordChangeEventParameter $param
952 959
 	 */
953 960
 	public function onDelete($param)
954 961
 	{
@@ -959,6 +966,7 @@  discard block
 block discarded – undo
959 966
 	 * Raised before the record attempt to update its data in the database.
960 967
 	 * To prevent the update operation, set the TActiveRecordChangeEventParameter::IsValid parameter to false.
961 968
 	 * @param TActiveRecordChangeEventParameter event parameter to be passed to the event handlers
969
+	 * @param TActiveRecordChangeEventParameter $param
962 970
 	 */
963 971
 	public function onUpdate($param)
964 972
 	{
@@ -1042,7 +1050,7 @@  discard block
 block discarded – undo
1042 1050
     
1043 1051
     	/**
1044 1052
      	* Return record data as JSON
1045
-     	* @return JSON
1053
+     	* @return string
1046 1054
      	* @since 3.2.4
1047 1055
      	*/
1048 1056
     	public function toJSON(){
Please login to merge, or discard this patch.
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
 	 * @var TActiveRecordInvalidFinderResult
195 195
 	 * @since 3.1.5
196 196
 	 */
197
-	protected $_invalidFinderResult = null; // use protected so that serialization is fine
197
+	protected $_invalidFinderResult=null; // use protected so that serialization is fine
198 198
 
199 199
 	/**
200 200
 	 * Prevent __call() method creating __sleep() when serializing.
201 201
 	 */
202 202
 	public function __sleep()
203 203
 	{
204
-		return array_diff(parent::__sleep(),array("\0*\0_connection"));
204
+		return array_diff(parent::__sleep(), array("\0*\0_connection"));
205 205
 	}
206 206
 
207 207
 	/**
@@ -256,12 +256,12 @@  discard block
 block discarded – undo
256 256
 	 * @param mixed property value.
257 257
 	 * @since 3.1.2
258 258
 	 */
259
-	public function __set($name,$value)
259
+	public function __set($name, $value)
260 260
 	{
261 261
 		if($this->hasRecordRelation($name) && !$this->canSetProperty($name))
262 262
 			$this->$name=$value;
263 263
 		else
264
-			parent::__set($name,$value);
264
+			parent::__set($name, $value);
265 265
 	}
266 266
 
267 267
 	/**
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 			$class=new ReflectionClass($className);
289 289
 			$relations=array();
290 290
 			foreach($class->getStaticPropertyValue('RELATIONS') as $key=>$value)
291
-				$relations[strtolower($key)]=array($key,$value);
291
+				$relations[strtolower($key)]=array($key, $value);
292 292
 			self::$_relations[$className]=$relations;
293 293
 		}
294 294
 	}
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		if(!is_array($data))
305 305
 			throw new TActiveRecordException('ar_data_invalid', get_class($this));
306 306
 		foreach($data as $name=>$value)
307
-			$this->setColumnValue($name,$value);
307
+			$this->setColumnValue($name, $value);
308 308
 	}
309 309
 
310 310
 
@@ -355,16 +355,16 @@  discard block
 block discarded – undo
355 355
 	{
356 356
 		if($record===null || get_class($this)!==get_class($record))
357 357
 			return false;
358
-		$tableInfo = $this->getRecordTableInfo();
359
-		$pks = $tableInfo->getPrimaryKeys();
360
-		$properties = count($pks) > 0 ? $pks : $tableInfo->getColumns()->getKeys();
358
+		$tableInfo=$this->getRecordTableInfo();
359
+		$pks=$tableInfo->getPrimaryKeys();
360
+		$properties=count($pks) > 0 ? $pks : $tableInfo->getColumns()->getKeys();
361 361
 		$equals=true;
362 362
 		foreach($properties as $prop)
363 363
 		{
364 364
 			if($strict)
365
-				$equals = $equals && $this->getColumnValue($prop) === $record->getColumnValue($prop);
365
+				$equals=$equals && $this->getColumnValue($prop)===$record->getColumnValue($prop);
366 366
 			else
367
-				$equals = $equals && $this->getColumnValue($prop) == $record->getColumnValue($prop);
367
+				$equals=$equals && $this->getColumnValue($prop)==$record->getColumnValue($prop);
368 368
 			if(!$equals)
369 369
 				return false;
370 370
 		}
@@ -382,10 +382,10 @@  discard block
 block discarded – undo
382 382
 	 */
383 383
 	public static function finder($className=__CLASS__)
384 384
 	{
385
-		static $finders = array();
385
+		static $finders=array();
386 386
 		if(!isset($finders[$className]))
387 387
 		{
388
-			$f = Prado::createComponent($className);
388
+			$f=Prado::createComponent($className);
389 389
 			$finders[$className]=$f;
390 390
 		}
391 391
 		return $finders[$className];
@@ -415,14 +415,14 @@  discard block
 block discarded – undo
415 415
 	 */
416 416
 	public function save()
417 417
 	{
418
-		$gateway = $this->getRecordGateway();
419
-		$param = new TActiveRecordChangeEventParameter();
418
+		$gateway=$this->getRecordGateway();
419
+		$param=new TActiveRecordChangeEventParameter();
420 420
 		if($this->_recordState===self::STATE_NEW)
421 421
 		{
422 422
 			$this->onInsert($param);
423 423
 			if($param->getIsValid() && $gateway->insert($this))
424 424
 			{
425
-				$this->_recordState = self::STATE_LOADED;
425
+				$this->_recordState=self::STATE_LOADED;
426 426
 				return true;
427 427
 			}
428 428
 		}
@@ -447,8 +447,8 @@  discard block
 block discarded – undo
447 447
 	{
448 448
 		if($this->_recordState===self::STATE_LOADED)
449 449
 		{
450
-			$gateway = $this->getRecordGateway();
451
-			$param = new TActiveRecordChangeEventParameter();
450
+			$gateway=$this->getRecordGateway();
451
+			$param=new TActiveRecordChangeEventParameter();
452 452
 			$this->onDelete($param);
453 453
 			if($param->getIsValid() && $gateway->delete($this))
454 454
 			{
@@ -488,8 +488,8 @@  discard block
 block discarded – undo
488 488
 	public function deleteByPk($keys)
489 489
 	{
490 490
 		if(func_num_args() > 1)
491
-			$keys = func_get_args();
492
-		return $this->getRecordGateway()->deleteRecordsByPk($this,(array)$keys);
491
+			$keys=func_get_args();
492
+		return $this->getRecordGateway()->deleteRecordsByPk($this, (array) $keys);
493 493
 	}
494 494
 
495 495
 	/**
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 	public function deleteAllByPks($keys)
499 499
 	{
500 500
 		if(func_num_args() > 1)
501
-			$keys = func_get_args();
501
+			$keys=func_get_args();
502 502
 		return $this->deleteByPk($keys);
503 503
 	}
504 504
 	/**
@@ -509,8 +509,8 @@  discard block
 block discarded – undo
509 509
 	 */
510 510
 	public function deleteAll($criteria=null, $parameters=array())
511 511
 	{
512
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
513
-		$criteria = $this->getRecordCriteria($criteria,$parameters, $args);
512
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
513
+		$criteria=$this->getRecordCriteria($criteria, $parameters, $args);
514 514
 		return $this->getRecordGateway()->deleteRecordsByCriteria($this, $criteria);
515 515
 	}
516 516
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	{
535 535
 		$result=array();
536 536
 		foreach($reader as $data)
537
-			$result[] = $this->populateObject($data);
537
+			$result[]=$this->populateObject($data);
538 538
 		return $result;
539 539
 	}
540 540
 
@@ -573,12 +573,12 @@  discard block
 block discarded – undo
573 573
 	 * @param mixed parameter values.
574 574
 	 * @return TActiveRecord matching record object. Null if no result is found.
575 575
 	 */
576
-	public function find($criteria,$parameters=array())
576
+	public function find($criteria, $parameters=array())
577 577
 	{
578
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
579
-		$criteria = $this->getRecordCriteria($criteria,$parameters, $args);
578
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
579
+		$criteria=$this->getRecordCriteria($criteria, $parameters, $args);
580 580
 		$criteria->setLimit(1);
581
-		$data = $this->getRecordGateway()->findRecordsByCriteria($this,$criteria);
581
+		$data=$this->getRecordGateway()->findRecordsByCriteria($this, $criteria);
582 582
 		return $this->populateObject($data);
583 583
 	}
584 584
 
@@ -589,12 +589,12 @@  discard block
 block discarded – undo
589 589
 	 * @param mixed parameter values.
590 590
 	 * @return array matching record objects. Empty array if no result is found.
591 591
 	 */
592
-	public function findAll($criteria=null,$parameters=array())
592
+	public function findAll($criteria=null, $parameters=array())
593 593
 	{
594
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
594
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
595 595
 		if($criteria!==null)
596
-			$criteria = $this->getRecordCriteria($criteria,$parameters, $args);
597
-		$result = $this->getRecordGateway()->findRecordsByCriteria($this,$criteria,true);
596
+			$criteria=$this->getRecordCriteria($criteria, $parameters, $args);
597
+		$result=$this->getRecordGateway()->findRecordsByCriteria($this, $criteria, true);
598 598
 		return $this->populateObjects($result);
599 599
 	}
600 600
 
@@ -612,11 +612,11 @@  discard block
 block discarded – undo
612 612
 	 */
613 613
 	public function findByPk($keys)
614 614
 	{
615
-		if($keys === null)
615
+		if($keys===null)
616 616
 			return null;
617 617
 		if(func_num_args() > 1)
618
-			$keys = func_get_args();
619
-		$data = $this->getRecordGateway()->findRecordByPK($this,$keys);
618
+			$keys=func_get_args();
619
+		$data=$this->getRecordGateway()->findRecordByPK($this, $keys);
620 620
 		return $this->populateObject($data);
621 621
 	}
622 622
 
@@ -640,8 +640,8 @@  discard block
 block discarded – undo
640 640
 	public function findAllByPks($keys)
641 641
 	{
642 642
 		if(func_num_args() > 1)
643
-			$keys = func_get_args();
644
-		$result = $this->getRecordGateway()->findRecordsByPks($this,(array)$keys);
643
+			$keys=func_get_args();
644
+		$result=$this->getRecordGateway()->findRecordsByPks($this, (array) $keys);
645 645
 		return $this->populateObjects($result);
646 646
 	}
647 647
 
@@ -653,12 +653,12 @@  discard block
 block discarded – undo
653 653
 	 * @param array $parameters
654 654
 	 * @return TActiveRecord, null if no result is returned.
655 655
 	 */
656
-	public function findBySql($sql,$parameters=array())
656
+	public function findBySql($sql, $parameters=array())
657 657
 	{
658
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
659
-		$criteria = $this->getRecordCriteria($sql,$parameters, $args);
658
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
659
+		$criteria=$this->getRecordCriteria($sql, $parameters, $args);
660 660
 		$criteria->setLimit(1);
661
-		$data = $this->getRecordGateway()->findRecordBySql($this,$criteria);
661
+		$data=$this->getRecordGateway()->findRecordBySql($this, $criteria);
662 662
 		return $this->populateObject($data);
663 663
 	}
664 664
 
@@ -670,11 +670,11 @@  discard block
 block discarded – undo
670 670
 	 * @param array $parameters
671 671
 	 * @return array matching active records. Empty array is returned if no result is found.
672 672
 	 */
673
-	public function findAllBySql($sql,$parameters=array())
673
+	public function findAllBySql($sql, $parameters=array())
674 674
 	{
675
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
676
-		$criteria = $this->getRecordCriteria($sql,$parameters, $args);
677
-		$result = $this->getRecordGateway()->findRecordsBySql($this,$criteria);
675
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
676
+		$criteria=$this->getRecordCriteria($sql, $parameters, $args);
677
+		$result=$this->getRecordGateway()->findRecordsBySql($this, $criteria);
678 678
 		return $this->populateObjects($result);
679 679
 	}
680 680
 
@@ -690,9 +690,9 @@  discard block
 block discarded – undo
690 690
 	 * @param array matching field values.
691 691
 	 * @return array matching active records. Empty array is returned if no result is found.
692 692
 	 */
693
-	public function findAllByIndex($criteria,$fields,$values)
693
+	public function findAllByIndex($criteria, $fields, $values)
694 694
 	{
695
-		$result = $this->getRecordGateway()->findRecordsByIndex($this,$criteria,$fields,$values);
695
+		$result=$this->getRecordGateway()->findRecordsByIndex($this, $criteria, $fields, $values);
696 696
 		return $this->populateObjects($result);
697 697
 	}
698 698
 
@@ -702,12 +702,12 @@  discard block
 block discarded – undo
702 702
 	 * @param mixed parameter values.
703 703
 	 * @return int number of records.
704 704
 	 */
705
-	public function count($criteria=null,$parameters=array())
705
+	public function count($criteria=null, $parameters=array())
706 706
 	{
707
-		$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
707
+		$args=func_num_args() > 1 ? array_slice(func_get_args(), 1) : null;
708 708
 		if($criteria!==null)
709
-			$criteria = $this->getRecordCriteria($criteria,$parameters, $args);
710
-		return $this->getRecordGateway()->countRecords($this,$criteria);
709
+			$criteria=$this->getRecordCriteria($criteria, $parameters, $args);
710
+		return $this->getRecordGateway()->countRecords($this, $criteria);
711 711
 	}
712 712
 
713 713
 	/**
@@ -717,11 +717,11 @@  discard block
 block discarded – undo
717 717
 	 * @param array method call arguments.
718 718
 	 * @return TActiveRecordRelation, null if the context or the handler doesn't exist
719 719
 	 */
720
-	protected function getRelationHandler($name,$args=array())
720
+	protected function getRelationHandler($name, $args=array())
721 721
 	{
722
-		if(($context=$this->createRelationContext($name)) !== null)
722
+		if(($context=$this->createRelationContext($name))!==null)
723 723
 		{
724
-			$criteria = $this->getRecordCriteria(count($args)>0 ? $args[0] : null, array_slice($args,1));
724
+			$criteria=$this->getRecordCriteria(count($args) > 0 ? $args[0] : null, array_slice($args, 1));
725 725
 			return $context->getRelationHandler($criteria);
726 726
 		}
727 727
 		else
@@ -741,8 +741,8 @@  discard block
 block discarded – undo
741 741
 	{
742 742
 		if(($definition=$this->getRecordRelation($name))!==null)
743 743
 		{
744
-			list($property, $relation) = $definition;
745
-			return new TActiveRecordRelationContext($this,$property,$relation);
744
+			list($property, $relation)=$definition;
745
+			return new TActiveRecordRelationContext($this, $property, $relation);
746 746
 		}
747 747
 		else
748 748
 			return null;
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 	 */
786 786
 	protected function fetchResultsFor($property)
787 787
 	{
788
-		if( ($context=$this->createRelationContext($property)) !== null)
788
+		if(($context=$this->createRelationContext($property))!==null)
789 789
 			return $context->getRelationHandler()->fetchResultsInto($this);
790 790
 		else
791 791
 			return false;
@@ -820,31 +820,31 @@  discard block
 block discarded – undo
820 820
 	 * @return mixed single record if method name starts with "findBy", 0 or more records
821 821
 	 * if method name starts with "findAllBy"
822 822
 	 */
823
-	public function __call($method,$args)
823
+	public function __call($method, $args)
824 824
 	{
825
-		$delete =false;
826
-		if(strncasecmp($method,'with',4)===0)
825
+		$delete=false;
826
+		if(strncasecmp($method, 'with', 4)===0)
827 827
 		{
828
-			$property= $method[4]==='_' ? substr($method,5) : substr($method,4);
828
+			$property=$method[4]==='_' ? substr($method, 5) : substr($method, 4);
829 829
 			return $this->getRelationHandler($property, $args);
830 830
 		}
831
-		else if($findOne=strncasecmp($method,'findby',6)===0)
832
-			$condition = $method[6]==='_' ? substr($method,7) : substr($method,6);
833
-		else if(strncasecmp($method,'findallby',9)===0)
834
-			$condition = $method[9]==='_' ? substr($method,10) : substr($method,9);
835
-		else if($delete=strncasecmp($method,'deleteby',8)===0)
836
-			$condition = $method[8]==='_' ? substr($method,9) : substr($method,8);
837
-		else if($delete=strncasecmp($method,'deleteallby',11)===0)
838
-			$condition = $method[11]==='_' ? substr($method,12) : substr($method,11);
831
+		else if($findOne=strncasecmp($method, 'findby', 6)===0)
832
+			$condition=$method[6]==='_' ? substr($method, 7) : substr($method, 6);
833
+		else if(strncasecmp($method, 'findallby', 9)===0)
834
+			$condition=$method[9]==='_' ? substr($method, 10) : substr($method, 9);
835
+		else if($delete=strncasecmp($method, 'deleteby', 8)===0)
836
+			$condition=$method[8]==='_' ? substr($method, 9) : substr($method, 8);
837
+		else if($delete=strncasecmp($method, 'deleteallby', 11)===0)
838
+			$condition=$method[11]==='_' ? substr($method, 12) : substr($method, 11);
839 839
 		else
840 840
 		{
841
-			if($this->getInvalidFinderResult() == TActiveRecordInvalidFinderResult::Exception)
842
-				throw new TActiveRecordException('ar_invalid_finder_method',$method);
841
+			if($this->getInvalidFinderResult()==TActiveRecordInvalidFinderResult::Exception)
842
+				throw new TActiveRecordException('ar_invalid_finder_method', $method);
843 843
 			else
844 844
 				return null;
845 845
 		}
846 846
 
847
-		$criteria = $this->getRecordGateway()->getCommand($this)->createCriteriaFromString($method, $condition, $args);
847
+		$criteria=$this->getRecordGateway()->getCommand($this)->createCriteriaFromString($method, $condition, $args);
848 848
 		if($delete)
849 849
 			return $this->deleteAll($criteria);
850 850
 		else
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 	 */
859 859
 	public function getInvalidFinderResult()
860 860
 	{
861
-		if($this->_invalidFinderResult !== null)
861
+		if($this->_invalidFinderResult!==null)
862 862
 			return $this->_invalidFinderResult;
863 863
 
864 864
 		return self::getRecordManager()->getInvalidFinderResult();
@@ -873,10 +873,10 @@  discard block
 block discarded – undo
873 873
 	 */
874 874
 	public function setInvalidFinderResult($value)
875 875
 	{
876
-		if($value === null)
877
-			$this->_invalidFinderResult = null;
876
+		if($value===null)
877
+			$this->_invalidFinderResult=null;
878 878
 		else
879
-			$this->_invalidFinderResult = TPropertyValue::ensureEnum($value, 'TActiveRecordInvalidFinderResult');
879
+			$this->_invalidFinderResult=TPropertyValue::ensureEnum($value, 'TActiveRecordInvalidFinderResult');
880 880
 	}
881 881
 
882 882
 	/**
@@ -892,8 +892,8 @@  discard block
 block discarded – undo
892 892
 	{
893 893
 		if(is_string($criteria))
894 894
 		{
895
-			$useArgs = !is_array($parameters) && is_array($args);
896
-			return new TActiveRecordCriteria($criteria,$useArgs ? $args : $parameters);
895
+			$useArgs=!is_array($parameters) && is_array($args);
896
+			return new TActiveRecordCriteria($criteria, $useArgs ? $args : $parameters);
897 897
 		}
898 898
 		else if($criteria instanceof TSqlCriteria)
899 899
 			return $criteria;
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 	 * @param mixed the corresponding column value
988 988
 	 * @since 3.1.1
989 989
 	 */
990
-	public function setColumnValue($columnName,$value)
990
+	public function setColumnValue($columnName, $value)
991 991
 	{
992 992
 		$className=get_class($this);
993 993
 		if(isset(self::$_columnMapping[$className][$columnName]))
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 	{
1005 1005
 		$className=get_class($this);
1006 1006
 		$property=strtolower($property);
1007
-		return isset(self::$_relations[$className][$property])?self::$_relations[$className][$property]:null;
1007
+		return isset(self::$_relations[$className][$property]) ? self::$_relations[$className][$property] : null;
1008 1008
 	}
1009 1009
 
1010 1010
 	/**
@@ -1031,9 +1031,9 @@  discard block
 block discarded – undo
1031 1031
         * @return array of column name and column values
1032 1032
         * @since 3.2.4
1033 1033
         */
1034
-        public function toArray(){
1034
+        public function toArray() {
1035 1035
         	$result=array();
1036
-        	foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName){
1036
+        	foreach($this->getRecordTableInfo()->getLowerCaseColumnNames() as $columnName) {
1037 1037
             		$result[$columnName]=$this->getColumnValue($columnName);
1038 1038
            	}
1039 1039
         
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
      	* @return JSON
1046 1046
      	* @since 3.2.4
1047 1047
      	*/
1048
-    	public function toJSON(){
1048
+    	public function toJSON() {
1049 1049
         	return json_encode($this->toArray());
1050 1050
     	}
1051 1051
 }
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
 	 */
1081 1081
 	public function setIsValid($value)
1082 1082
 	{
1083
-		$this->_isValid = TPropertyValue::ensureBoolean($value);
1083
+		$this->_isValid=TPropertyValue::ensureBoolean($value);
1084 1084
 	}
1085 1085
 }
1086 1086
 
@@ -1102,6 +1102,6 @@  discard block
 block discarded – undo
1102 1102
  */
1103 1103
 class TActiveRecordInvalidFinderResult extends TEnumerable
1104 1104
 {
1105
-	const Null = 'Null';
1106
-	const Exception = 'Exception';
1105
+	const Null='Null';
1106
+	const Exception='Exception';
1107 1107
 }
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -425,14 +425,12 @@  discard block
 block discarded – undo
425 425
 				$this->_recordState = self::STATE_LOADED;
426 426
 				return true;
427 427
 			}
428
-		}
429
-		else if($this->_recordState===self::STATE_LOADED)
428
+		} else if($this->_recordState===self::STATE_LOADED)
430 429
 		{
431 430
 			$this->onUpdate($param);
432 431
 			if($param->getIsValid() && $gateway->update($this))
433 432
 				return true;
434
-		}
435
-		else
433
+		} else
436 434
 			throw new TActiveRecordException('ar_save_invalid', get_class($this));
437 435
 
438 436
 		return false;
@@ -455,8 +453,7 @@  discard block
 block discarded – undo
455 453
 				$this->_recordState=self::STATE_DELETED;
456 454
 				return true;
457 455
 			}
458
-		}
459
-		else
456
+		} else
460 457
 			throw new TActiveRecordException('ar_delete_invalid', get_class($this));
461 458
 
462 459
 		return false;
@@ -723,8 +720,7 @@  discard block
 block discarded – undo
723 720
 		{
724 721
 			$criteria = $this->getRecordCriteria(count($args)>0 ? $args[0] : null, array_slice($args,1));
725 722
 			return $context->getRelationHandler($criteria);
726
-		}
727
-		else
723
+		} else
728 724
 			return null;
729 725
 	}
730 726
 
@@ -743,8 +739,7 @@  discard block
 block discarded – undo
743 739
 		{
744 740
 			list($property, $relation) = $definition;
745 741
 			return new TActiveRecordRelationContext($this,$property,$relation);
746
-		}
747
-		else
742
+		} else
748 743
 			return null;
749 744
 	}
750 745
 
@@ -827,8 +822,7 @@  discard block
 block discarded – undo
827 822
 		{
828 823
 			$property= $method[4]==='_' ? substr($method,5) : substr($method,4);
829 824
 			return $this->getRelationHandler($property, $args);
830
-		}
831
-		else if($findOne=strncasecmp($method,'findby',6)===0)
825
+		} else if($findOne=strncasecmp($method,'findby',6)===0)
832 826
 			$condition = $method[6]==='_' ? substr($method,7) : substr($method,6);
833 827
 		else if(strncasecmp($method,'findallby',9)===0)
834 828
 			$condition = $method[9]==='_' ? substr($method,10) : substr($method,9);
@@ -894,8 +888,7 @@  discard block
 block discarded – undo
894 888
 		{
895 889
 			$useArgs = !is_array($parameters) && is_array($args);
896 890
 			return new TActiveRecordCriteria($criteria,$useArgs ? $args : $parameters);
897
-		}
898
-		else if($criteria instanceof TSqlCriteria)
891
+		} else if($criteria instanceof TSqlCriteria)
899 892
 			return $criteria;
900 893
 		else
901 894
 			return new TActiveRecordCriteria();
Please login to merge, or discard this patch.
framework/Data/Common/Sqlite/TSqliteCommandBuilder.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TSqliteCommandBuilder class file.
4
- *
5
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.Data.Common
10
- */
3
+	 * TSqliteCommandBuilder class file.
4
+	 *
5
+	 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.Data.Common
10
+	 */
11 11
 
12 12
 Prado::using('System.Data.Common.TDbCommandBuilder');
13 13
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
 		if ($this->sourcepath === NULL)
59 59
 		{
60 60
 			$this->sourcepath = $sourcepath;
61
-		}
62
-		else
61
+		} else
63 62
 		{
64 63
 			$this->sourcepath->append($sourcepath);
65 64
 		}
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
 	 */
31 31
 	public function applyLimitOffset($sql, $limit=-1, $offset=-1)
32 32
 	{
33
-		$limit = $limit!==null ? intval($limit) : -1;
34
-		$offset = $offset!==null ? intval($offset) : -1;
33
+		$limit=$limit!==null ? intval($limit) : -1;
34
+		$offset=$offset!==null ? intval($offset) : -1;
35 35
 		if($limit > 0 || $offset > 0)
36 36
 		{
37
-			$limitStr = ' LIMIT '.$limit;
38
-			$offsetStr = $offset >= 0 ? ' OFFSET '.$offset : '';
37
+			$limitStr=' LIMIT '.$limit;
38
+			$offsetStr=$offset >= 0 ? ' OFFSET '.$offset : '';
39 39
 			return $sql.$limitStr.$offsetStr;
40 40
 		}
41 41
 		else
Please login to merge, or discard this patch.
framework/Util/TSimpleDateFormatter.php 4 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TSimpleDateFormatter class file
4
- *
5
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.Util
10
- */
3
+	 * TSimpleDateFormatter class file
4
+	 *
5
+	 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.Util
10
+	 */
11 11
 
12 12
 /**
13 13
  * TSimpleDateFormatter class.
Please login to merge, or discard this patch.
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -93,6 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 	/**
95 95
 	 * @param string formatting charset.
96
+	 * @param string $charset
96 97
 	 */
97 98
 	public function setCharset($charset)
98 99
 	{
@@ -313,6 +314,7 @@  discard block
 block discarded – undo
313 314
 
314 315
 	/**
315 316
 	 * Calculate the length of a string, may be consider iconv_strlen?
317
+	 * @param string $string
316 318
 	 */
317 319
 	private function length($string)
318 320
 	{
@@ -338,6 +340,9 @@  discard block
 block discarded – undo
338 340
 
339 341
 	/**
340 342
 	 * Returns true if char at position equals a particular char.
343
+	 * @param string $string
344
+	 * @param integer $pos
345
+	 * @param string $char
341 346
 	 */
342 347
 	private function charEqual($string, $pos, $char)
343 348
 	{
@@ -350,6 +355,10 @@  discard block
 block discarded – undo
350 355
 	 * @param int starting position
351 356
 	 * @param int minimum integer length
352 357
 	 * @param int maximum integer length
358
+	 * @param string $str
359
+	 * @param integer $i
360
+	 * @param integer|null $minlength
361
+	 * @param integer|null $maxlength
353 362
 	 * @return string integer portion of the string, null otherwise
354 363
 	 */
355 364
 	private function getInteger($str,$i,$minlength,$maxlength)
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -225,8 +225,7 @@  discard block
 block discarded – undo
225 225
 			$year = "{$date['year']}";
226 226
 			$month = $date['mon'];
227 227
 			$day = $date['mday'];
228
-		}
229
-		else
228
+		} else
230 229
 		{
231 230
 			$year = null;
232 231
 			$month = null;
@@ -262,8 +261,7 @@  discard block
 block discarded – undo
262 261
 						$year = $iYear + 2000;
263 262
 				}
264 263
 				$year = (int)$year;
265
-			}
266
-			elseif($token=='MM' || $token=='M')
264
+			} elseif($token=='MM' || $token=='M')
267 265
 			{
268 266
 				$month=$this->getInteger($value,$i_val,
269 267
 									$this->length($token),2);
@@ -273,8 +271,7 @@  discard block
 block discarded – undo
273 271
 					//throw new TInvalidDataValueException('Invalid month', $value);
274 272
 				$i_val += strlen($month);
275 273
 				$month = $iMonth;
276
-			}
277
-			elseif ($token=='dd' || $token=='d')
274
+			} elseif ($token=='dd' || $token=='d')
278 275
 			{
279 276
 				$day = $this->getInteger($value,$i_val,
280 277
 									$this->length($token), 2);
@@ -284,8 +281,7 @@  discard block
 block discarded – undo
284 281
 					//throw new TInvalidDataValueException('Invalid day', $value);
285 282
 				$i_val += strlen($day);
286 283
 				$day = $iDay;
287
-			}
288
-			else
284
+			} else
289 285
 			{
290 286
 				if($this->substring($value, $i_val, $this->length($token)) != $token)
291 287
 					return null;
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * Charset, default is 'UTF-8'
55 55
 	 * @var string
56 56
 	 */
57
-	private $charset = 'UTF-8';
57
+	private $charset='UTF-8';
58 58
 
59 59
 	/**
60 60
 	 * Constructor, create a new date time formatter.
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function setPattern($pattern)
82 82
 	{
83
-		$this->pattern = $pattern;
83
+		$this->pattern=$pattern;
84 84
 	}
85 85
 
86 86
 	/**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function setCharset($charset)
98 98
 	{
99
-		$this->charset = $charset;
99
+		$this->charset=$charset;
100 100
 	}
101 101
 
102 102
 	/**
@@ -106,17 +106,17 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function format($value)
108 108
 	{
109
-		$date = $this->getDate($value);
110
-		$bits['yyyy'] = $date['year'];
111
-		$bits['yy'] = substr("{$date['year']}", -2);
109
+		$date=$this->getDate($value);
110
+		$bits['yyyy']=$date['year'];
111
+		$bits['yy']=substr("{$date['year']}", -2);
112 112
 
113
-		$bits['MM'] = str_pad("{$date['mon']}", 2, '0', STR_PAD_LEFT);
114
-		$bits['M'] = $date['mon'];
113
+		$bits['MM']=str_pad("{$date['mon']}", 2, '0', STR_PAD_LEFT);
114
+		$bits['M']=$date['mon'];
115 115
 
116
-		$bits['dd'] = str_pad("{$date['mday']}", 2, '0', STR_PAD_LEFT);
117
-		$bits['d'] = $date['mday'];
116
+		$bits['dd']=str_pad("{$date['mday']}", 2, '0', STR_PAD_LEFT);
117
+		$bits['d']=$date['mday'];
118 118
 
119
-		$pattern = preg_replace('/M{3,4}/', 'MM', $this->pattern);
119
+		$pattern=preg_replace('/M{3,4}/', 'MM', $this->pattern);
120 120
 		return str_replace(array_keys($bits), $bits, $pattern);
121 121
 	}
122 122
 
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
 
154 154
 	public function getDayMonthYearOrdering()
155 155
 	{
156
-		$ordering = array();
157
-		if(is_int($day= strpos($this->pattern, 'd')))
158
-			$ordering['day'] = $day;
159
-		if(is_int($month= strpos($this->pattern, 'M')))
160
-			$ordering['month'] = $month;
161
-		if(is_int($year= strpos($this->pattern, 'yy')))
162
-			$ordering['year'] = $year;
156
+		$ordering=array();
157
+		if(is_int($day=strpos($this->pattern, 'd')))
158
+			$ordering['day']=$day;
159
+		if(is_int($month=strpos($this->pattern, 'M')))
160
+			$ordering['month']=$month;
161
+		if(is_int($year=strpos($this->pattern, 'yy')))
162
+			$ordering['year']=$year;
163 163
 		asort($ordering);
164 164
 		return array_keys($ordering);
165 165
 	}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	private function getDate($value)
173 173
 	{
174
-		$s = Prado::createComponent('System.Util.TDateTimeStamp');
174
+		$s=Prado::createComponent('System.Util.TDateTimeStamp');
175 175
 		if(is_numeric($value))
176 176
 			return $s->getDate($value);
177 177
 		else
@@ -183,10 +183,10 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	public function isValidDate($value)
185 185
 	{
186
-		if($value === null) {
186
+		if($value===null) {
187 187
 			return false;
188 188
 		} else {
189
-			return $this->parse($value, false) !== null;
189
+			return $this->parse($value, false)!==null;
190 190
 		}
191 191
 	}
192 192
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	 * @return int date time stamp
197 197
 	 * @throws TInvalidDataValueException if date string is malformed.
198 198
 	 */
199
-	public function parse($value,$defaultToCurrentTime=true)
199
+	public function parse($value, $defaultToCurrentTime=true)
200 200
 	{
201 201
 		if(is_int($value) || is_float($value))
202 202
 			return $value;
@@ -205,108 +205,108 @@  discard block
 block discarded – undo
205 205
 
206 206
 		if(empty($this->pattern)) return time();
207 207
 
208
-		$date = time();
208
+		$date=time();
209 209
 
210 210
 		if($this->length(trim($value)) < 1)
211 211
 			return $defaultToCurrentTime ? $date : null;
212 212
 
213
-		$pattern = $this->pattern;
213
+		$pattern=$this->pattern;
214 214
 
215
-		$i_val = 0;
216
-		$i_format = 0;
217
-		$pattern_length = $this->length($pattern);
218
-		$c = '';
215
+		$i_val=0;
216
+		$i_format=0;
217
+		$pattern_length=$this->length($pattern);
218
+		$c='';
219 219
 		$token='';
220 220
 		$x=null; $y=null;
221 221
 
222 222
 
223 223
 		if($defaultToCurrentTime)
224 224
 		{
225
-			$year = "{$date['year']}";
226
-			$month = $date['mon'];
227
-			$day = $date['mday'];
225
+			$year="{$date['year']}";
226
+			$month=$date['mon'];
227
+			$day=$date['mday'];
228 228
 		}
229 229
 		else
230 230
 		{
231
-			$year = null;
232
-			$month = null;
233
-			$day = null;
231
+			$year=null;
232
+			$month=null;
233
+			$day=null;
234 234
 		}
235 235
 
236
-		while ($i_format < $pattern_length)
236
+		while($i_format < $pattern_length)
237 237
 		{
238
-			$c = $this->charAt($pattern,$i_format);
238
+			$c=$this->charAt($pattern, $i_format);
239 239
 			$token='';
240
-			while ($this->charEqual($pattern, $i_format, $c)
240
+			while($this->charEqual($pattern, $i_format, $c)
241 241
 						&& ($i_format < $pattern_length))
242 242
 			{
243
-				$token .= $this->charAt($pattern, $i_format++);
243
+				$token.=$this->charAt($pattern, $i_format++);
244 244
 			}
245 245
 
246
-			if ($token=='yyyy' || $token=='yy' || $token=='y')
246
+			if($token=='yyyy' || $token=='yy' || $token=='y')
247 247
 			{
248
-				if ($token=='yyyy') { $x=4;$y=4; }
249
-				if ($token=='yy')   { $x=2;$y=2; }
250
-				if ($token=='y')    { $x=2;$y=4; }
251
-				$year = $this->getInteger($value,$i_val,$x,$y);
252
-				if($year === null)
248
+				if($token=='yyyy') { $x=4; $y=4; }
249
+				if($token=='yy') { $x=2; $y=2; }
250
+				if($token=='y') { $x=2; $y=4; }
251
+				$year=$this->getInteger($value, $i_val, $x, $y);
252
+				if($year===null)
253 253
 					return null;
254 254
 					//throw new TInvalidDataValueException('Invalid year', $value);
255
-				$i_val += strlen($year);
256
-				if(strlen($year) == 2)
255
+				$i_val+=strlen($year);
256
+				if(strlen($year)==2)
257 257
 				{
258
-					$iYear = (int)$year;
258
+					$iYear=(int) $year;
259 259
 					if($iYear > 70)
260
-						$year = $iYear + 1900;
260
+						$year=$iYear + 1900;
261 261
 					else
262
-						$year = $iYear + 2000;
262
+						$year=$iYear + 2000;
263 263
 				}
264
-				$year = (int)$year;
264
+				$year=(int) $year;
265 265
 			}
266 266
 			elseif($token=='MM' || $token=='M')
267 267
 			{
268
-				$month=$this->getInteger($value,$i_val,
269
-									$this->length($token),2);
270
-				$iMonth = (int)$month;
271
-				if($month === null || $iMonth < 1 || $iMonth > 12 )
268
+				$month=$this->getInteger($value, $i_val,
269
+									$this->length($token), 2);
270
+				$iMonth=(int) $month;
271
+				if($month===null || $iMonth < 1 || $iMonth > 12)
272 272
 					return null;
273 273
 					//throw new TInvalidDataValueException('Invalid month', $value);
274
-				$i_val += strlen($month);
275
-				$month = $iMonth;
274
+				$i_val+=strlen($month);
275
+				$month=$iMonth;
276 276
 			}
277
-			elseif ($token=='dd' || $token=='d')
277
+			elseif($token=='dd' || $token=='d')
278 278
 			{
279
-				$day = $this->getInteger($value,$i_val,
279
+				$day=$this->getInteger($value, $i_val,
280 280
 									$this->length($token), 2);
281
-				$iDay = (int)$day;
282
-				if($day === null || $iDay < 1 || $iDay >31)
281
+				$iDay=(int) $day;
282
+				if($day===null || $iDay < 1 || $iDay > 31)
283 283
 					return null;
284 284
 					//throw new TInvalidDataValueException('Invalid day', $value);
285
-				$i_val += strlen($day);
286
-				$day = $iDay;
285
+				$i_val+=strlen($day);
286
+				$day=$iDay;
287 287
 			}
288 288
 			else
289 289
 			{
290
-				if($this->substring($value, $i_val, $this->length($token)) != $token)
290
+				if($this->substring($value, $i_val, $this->length($token))!=$token)
291 291
 					return null;
292 292
 					//throw new TInvalidDataValueException("Subpattern '{$this->pattern}' mismatch", $value);
293 293
 				else
294
-					$i_val += $this->length($token);
294
+					$i_val+=$this->length($token);
295 295
 			}
296 296
 		}
297
-		if ($i_val != $this->length($value))
297
+		if($i_val!=$this->length($value))
298 298
 			return null;
299 299
 			//throw new TInvalidDataValueException("Pattern '{$this->pattern}' mismatch", $value);
300
-		if(!$defaultToCurrentTime && ($month === null || $day === null || $year === null))
300
+		if(!$defaultToCurrentTime && ($month===null || $day===null || $year===null))
301 301
 			return null;
302 302
 		else
303 303
 		{
304 304
 			if(empty($year)) {
305
-				$year = date('Y');
305
+				$year=date('Y');
306 306
 			}
307
-			$day = (int)$day <= 0 ? 1 : (int)$day;
308
-			$month = (int)$month <= 0 ? 1 : (int)$month;
309
-			$s = Prado::createComponent('System.Util.TDateTimeStamp');
307
+			$day=(int) $day <= 0 ? 1 : (int) $day;
308
+			$month=(int) $month <= 0 ? 1 : (int) $month;
309
+			$s=Prado::createComponent('System.Util.TDateTimeStamp');
310 310
 			return $s->getTimeStamp(0, 0, 0, $month, $day, $year);
311 311
 		}
312 312
 	}
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	 */
342 342
 	private function charEqual($string, $pos, $char)
343 343
 	{
344
-		return $this->charAt($string, $pos) == $char;
344
+		return $this->charAt($string, $pos)==$char;
345 345
 	}
346 346
 
347 347
 	/**
@@ -352,15 +352,15 @@  discard block
 block discarded – undo
352 352
 	 * @param int maximum integer length
353 353
 	 * @return string integer portion of the string, null otherwise
354 354
 	 */
355
-	private function getInteger($str,$i,$minlength,$maxlength)
355
+	private function getInteger($str, $i, $minlength, $maxlength)
356 356
 	{
357 357
 		//match for digits backwards
358
-		for ($x = $maxlength; $x >= $minlength; $x--)
358
+		for($x=$maxlength; $x >= $minlength; $x--)
359 359
 		{
360
-			$token= $this->substring($str, $i,$x);
361
-			if ($this->length($token) < $minlength)
360
+			$token=$this->substring($str, $i, $x);
361
+			if($this->length($token) < $minlength)
362 362
 				return null;
363
-			if (preg_match('/^\d+$/', $token))
363
+			if(preg_match('/^\d+$/', $token))
364 364
 				return $token;
365 365
 		}
366 366
 		return null;
Please login to merge, or discard this patch.
framework/Web/UI/JuiControls/TJuiDatePicker.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TJuiDatePicker class file.
4
- *
5
- * @author LANDWEHR Computer und Software GmbH <[email protected]>
6
- * @link http://www.landwehr-software.de/
7
- * @copyright Copyright &copy; 2015 LANDWEHR Computer und Software GmbH
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.Web.UI.ActiveControls
10
- */
3
+	 * TJuiDatePicker class file.
4
+	 *
5
+	 * @author LANDWEHR Computer und Software GmbH <[email protected]>
6
+	 * @link http://www.landwehr-software.de/
7
+	 * @copyright Copyright &copy; 2015 LANDWEHR Computer und Software GmbH
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.Web.UI.ActiveControls
10
+	 */
11 11
 
12 12
 /**
13 13
  * Load active text box.
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 	{
91 91
 		return array('altField', 'altFormat', 'appendText', 'autoSize', 'buttonImage', 'buttonImageOnly', 'buttonText', 'calculateWeek',
92 92
 								 'changeMonth', 'changeYear', 'closeText', 'constrainInput', 'currentText', 'dateFormat', 'dayNames', 'dayNamesMin',
93
-				         'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate',
93
+						 'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate',
94 94
 								 'minDate', 'monthNames', 'monthNamesShort', 'navigationAsDateFormat', 'nextText', 'numberOfMonths', 'prevText',
95 95
 								 'selectOtherMonths', 'shortYearCutoff', 'showAnim', 'showButtonPanel', 'showCurrentAtPos', 'showMonthAfterYear',
96
-				         'showOn', 'showOptions', 'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange', 'yearSuffix',
96
+						 'showOn', 'showOptions', 'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange', 'yearSuffix',
97 97
 								 'beforeShow', 'beforeShowDay', 'onChangeMonthYear', 'onClose', 'onSelect');
98 98
 	}
99 99
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 * it will register an additional clientscript to set the language specific global default settings.
40 40
 	 * @var boolean true, if this is the first instance of TJuiDatePicker, false otherwise
41 41
 	 */
42
-	private static $_first = true;
42
+	private static $_first=true;
43 43
 
44 44
 	/**
45 45
 	 * Creates a new callback control, sets the adapter to
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function getOptions()
76 76
 	{
77
-		if (($options=$this->getViewState('JuiOptions'))===null)
77
+		if(($options=$this->getViewState('JuiOptions'))===null)
78 78
 		{
79 79
 		  $options=new TJuiControlOptions($this);
80 80
 		  $this->setViewState('JuiOptions', $options);
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	protected function getCurrentCulture()
170 170
 	{
171
-		$app = $this->getApplication()->getGlobalization(false);
172
-		return $this->getCulture() == '' ?
171
+		$app=$this->getApplication()->getGlobalization(false);
172
+		return $this->getCulture()=='' ?
173 173
 				($app ? $app->getCulture() : 'en') : $this->getCulture();
174 174
 	}
175 175
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	 */
179 179
 	public function getDateFormat()
180 180
 	{
181
-		return $this->getViewState('DateFormat','dd-MM-yyyy');
181
+		return $this->getViewState('DateFormat', 'dd-MM-yyyy');
182 182
 	}
183 183
 
184 184
 	/**
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	public function setDateFormat($value)
189 189
 	{
190
-		$this->setViewState('DateFormat',$value,'dd-MM-yyyy');
190
+		$this->setViewState('DateFormat', $value, 'dd-MM-yyyy');
191 191
 	}
192 192
 
193 193
 	/**
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
 			$this->setText('');
254 254
 		else
255 255
 		{
256
-			$date = TPropertyValue::ensureFloat($value);
257
-			$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());
256
+			$date=TPropertyValue::ensureFloat($value);
257
+			$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $this->getDateFormat());
258 258
 			$this->setText($formatter->format($date));
259 259
 		}
260 260
 	}
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	protected function getTimeStampFromText()
267 267
 	{
268
-		$pattern = $this->getDateFormat();
269
-		$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
270
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern);
268
+		$pattern=$this->getDateFormat();
269
+		$pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern);
270
+		$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern);
271 271
 		return $formatter->parse($this->getText());
272 272
 	}
273 273
 
@@ -278,10 +278,10 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	public function getValidationPropertyValue()
280 280
 	{
281
-		if(($text = $this->getText()) === '')
281
+		if(($text=$this->getText())==='')
282 282
 			return '';
283
-		$date = $this->getTimeStamp();
284
-		return $date == null ? $text : $date;
283
+		$date=$this->getTimeStamp();
284
+		return $date==null ? $text : $date;
285 285
 	}
286 286
 
287 287
 }
288 288
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDataRenderer.php 1 patch
Indentation   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TDataRenderer class file
4
- *
5
- * @author Qiang Xue <[email protected]>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.Web.UI.WebControls
10
- * @since 3.1.2
11
- */
3
+	 * TDataRenderer class file
4
+	 *
5
+	 * @author Qiang Xue <[email protected]>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2015 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.Web.UI.WebControls
10
+	 * @since 3.1.2
11
+	 */
12 12
 
13 13
 /**
14 14
  * TDataRenderer class
@@ -19,7 +19,6 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * The following property is provided by TDataRenderer:
21 21
  * - {@link getData Data}: data associated with this renderer.
22
-
23 22
  * @author Qiang Xue <[email protected]>
24 23
  * @package System.Web.UI.WebControls
25 24
  * @since 3.1.2
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TPanel.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
 
102 102
 	/**
103 103
 	 * Sets the horizontal alignment of the contents within the panel.
104
-     * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center'
104
+	 * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center'
105 105
 	 * @param string the horizontal alignment
106 106
 	 */
107 107
 	public function setHorizontalAlign($value)
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	{
72 72
 		parent::addAttributesToRender($writer);
73 73
 		if(($butt=$this->getDefaultButton())!=='')
74
-			$writer->addAttribute('id',$this->getClientID());
74
+			$writer->addAttribute('id', $this->getClientID());
75 75
 	}
76 76
 
77 77
 	/**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	public function getGroupingText()
170 170
 	{
171
-		return $this->getViewState('GroupingText','');
171
+		return $this->getViewState('GroupingText', '');
172 172
 	}
173 173
 
174 174
 	/**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public function setGroupingText($value)
178 178
 	{
179
-		$this->setViewState('GroupingText',$value,'');
179
+		$this->setViewState('GroupingText', $value, '');
180 180
 	}
181 181
 
182 182
 	/**
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		if(($butt=$this->getDefaultButton())!=='')
231 231
 		{
232 232
 			if(($button=$this->findControl($butt))===null)
233
-				throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt);
233
+				throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt);
234 234
 			else
235 235
 				$this->getPage()->getClientScript()->registerDefaultButton($this, $button);
236 236
 		}
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveLabel.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
 	 * @param THtmlWriter the writer used for the rendering purpose
61 61
 	 */
62 62
 	protected function addAttributesToRender($writer) {
63
-	    $writer->addAttribute('id',$this->getClientID());
64
-	    parent::addAttributesToRender($writer);
63
+		$writer->addAttribute('id',$this->getClientID());
64
+		parent::addAttributesToRender($writer);
65 65
 	}
66 66
 
67 67
 	/**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
 	 * @param THtmlWriter the writer used for the rendering purpose
82 82
 	 */
83 83
 	protected function addAttributesToRender($writer) {
84
-	    $writer->addAttribute('id',$this->getClientID());
84
+	    $writer->addAttribute('id', $this->getClientID());
85 85
 	    parent::addAttributesToRender($writer);
86 86
 	}
87 87
 }
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveDataList.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
    */
32 32
   public function __construct()
33 33
   {
34
-    parent::__construct();
35
-    $this->setAdapter(new TActiveControlAdapter($this));
34
+	parent::__construct();
35
+	$this->setAdapter(new TActiveControlAdapter($this));
36 36
   }
37 37
 
38 38
   /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
    */
41 41
   public function getActiveControl()
42 42
   {
43
-    return $this->getAdapter()->getBaseActiveControl();
43
+	return $this->getAdapter()->getBaseActiveControl();
44 44
   }
45 45
 
46 46
   /**
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
    */
53 53
   public function setDataSource($value)
54 54
   {
55
-    parent::setDataSource($value);
56
-    if($this->getActiveControl()->canUpdateClientSide()) {
57
-      $this->renderPager();
58
-      $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
59
-    }
55
+	parent::setDataSource($value);
56
+	if($this->getActiveControl()->canUpdateClientSide()) {
57
+	  $this->renderPager();
58
+	  $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
59
+	}
60 60
   }
61 61
 
62 62
   /**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
    */
66 66
   protected function getContainerID()
67 67
   {
68
-    return $this->ClientID.'_Container';
68
+	return $this->ClientID.'_Container';
69 69
   }
70 70
 
71 71
   /**
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
    */
77 77
   public function render($writer)
78 78
   {
79
-    if($this->getHasPreRendered()) {
80
-      $this->renderDataList($writer);
81
-      if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
82
-    }
83
-    else {
84
-      $this->getPage()->getAdapter()->registerControlToRender($this,$writer);
85
-    }
79
+	if($this->getHasPreRendered()) {
80
+	  $this->renderDataList($writer);
81
+	  if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
82
+	}
83
+	else {
84
+	  $this->getPage()->getAdapter()->registerControlToRender($this,$writer);
85
+	}
86 86
   }
87 87
 
88 88
   /**
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
    */
93 93
   private function renderPager()
94 94
   {
95
-    $pager=$this->getPage()->findControlsByType('TActivePager', false);
96
-    foreach($pager as $item)
97
-    {
98
-      if($item->ControlToPaginate==$this->ID) {
99
-        $writer=$this->getResponse()->createHtmlWriter();
100
-        $this->getPage()->getAdapter()->registerControlToRender($item,$writer);
101
-      }
102
-    }
95
+	$pager=$this->getPage()->findControlsByType('TActivePager', false);
96
+	foreach($pager as $item)
97
+	{
98
+	  if($item->ControlToPaginate==$this->ID) {
99
+		$writer=$this->getResponse()->createHtmlWriter();
100
+		$this->getPage()->getAdapter()->registerControlToRender($item,$writer);
101
+	  }
102
+	}
103 103
   }
104 104
 
105 105
   /**
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
    */
110 110
   private function renderDataList($writer)
111 111
   {
112
-    $writer->write('<span id="'.$this->getContainerID().'">');
113
-    parent::render($writer);
114
-    $writer->write('</span>');
112
+	$writer->write('<span id="'.$this->getContainerID().'">');
113
+	parent::render($writer);
114
+	$writer->write('</span>');
115 115
   }
116 116
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
     if($this->getHasPreRendered()) {
80 80
       $this->renderDataList($writer);
81 81
       if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
82
-    }
83
-    else {
82
+    } else {
84 83
       $this->getPage()->getAdapter()->registerControlToRender($this,$writer);
85 84
     }
86 85
   }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     parent::setDataSource($value);
56 56
     if($this->getActiveControl()->canUpdateClientSide()) {
57 57
       $this->renderPager();
58
-      $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
58
+      $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
59 59
     }
60 60
   }
61 61
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
   {
79 79
     if($this->getHasPreRendered()) {
80 80
       $this->renderDataList($writer);
81
-      if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
81
+      if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer);
82 82
     }
83 83
     else {
84
-      $this->getPage()->getAdapter()->registerControlToRender($this,$writer);
84
+      $this->getPage()->getAdapter()->registerControlToRender($this, $writer);
85 85
     }
86 86
   }
87 87
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
       if($item->ControlToPaginate==$this->ID) {
99 99
         $writer=$this->getResponse()->createHtmlWriter();
100
-        $this->getPage()->getAdapter()->registerControlToRender($item,$writer);
100
+        $this->getPage()->getAdapter()->registerControlToRender($item, $writer);
101 101
       }
102 102
     }
103 103
   }
Please login to merge, or discard this patch.