Completed
Push — fix_585 ( 4bfff7 )
by Fabio
11:03
created
framework/TComponent.php 1 patch
Spacing   +227 added lines, -227 removed lines patch added patch discarded remove patch
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	 * that start with 'fx' are filtered in.
374 374
 	 */
375 375
 	private function filter_prado_fx($name) {
376
-		return strncasecmp($name,'fx',2)===0;
376
+		return strncasecmp($name, 'fx', 2)===0;
377 377
 	}
378 378
 
379 379
 
@@ -383,13 +383,13 @@  discard block
 block discarded – undo
383 383
 	 * @param boolean optional should the names be all lowercase true/false
384 384
 	 * @return array array of strings being the class hierarchy of $this.
385 385
 	 */
386
-	public function getClassHierarchy($lowercase = false)
386
+	public function getClassHierarchy($lowercase=false)
387 387
 	{
388 388
 		$class=get_class($this);
389 389
 		$classes=array($class);
390
-		while($class=get_parent_class($class)){array_unshift($classes,$class);}
390
+		while($class=get_parent_class($class)) {array_unshift($classes, $class); }
391 391
 		if($lowercase)
392
-			return array_map('strtolower',$classes);
392
+			return array_map('strtolower', $classes);
393 393
 		return $classes;
394 394
 	}
395 395
 
@@ -412,14 +412,14 @@  discard block
 block discarded – undo
412 412
 		if($this->_listeningenabled)
413 413
 			return;
414 414
 
415
-		$fx=array_filter(get_class_methods($this),array($this,'filter_prado_fx'));
415
+		$fx=array_filter(get_class_methods($this), array($this, 'filter_prado_fx'));
416 416
 
417 417
 		foreach($fx as $func)
418
-			$this->attachEventHandler($func,array($this,$func));
418
+			$this->attachEventHandler($func, array($this, $func));
419 419
 
420
-		if(is_a($this,'IDynamicMethods')) {
421
-			$this->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER,array($this,'__dycall'));
422
-			array_push($fx,TComponent::GLOBAL_RAISE_EVENT_LISTENER);
420
+		if(is_a($this, 'IDynamicMethods')) {
421
+			$this->attachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($this, '__dycall'));
422
+			array_push($fx, TComponent::GLOBAL_RAISE_EVENT_LISTENER);
423 423
 		}
424 424
 
425 425
 		$this->_listeningenabled=true;
@@ -446,14 +446,14 @@  discard block
 block discarded – undo
446 446
 		if(!$this->_listeningenabled)
447 447
 			return;
448 448
 
449
-		$fx=array_filter(get_class_methods($this),array($this,'filter_prado_fx'));
449
+		$fx=array_filter(get_class_methods($this), array($this, 'filter_prado_fx'));
450 450
 
451 451
 		foreach($fx as $func)
452
-			$this->detachEventHandler($func,array($this,$func));
452
+			$this->detachEventHandler($func, array($this, $func));
453 453
 
454
-		if(is_a($this,'IDynamicMethods')) {
455
-			$this->detachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER,array($this,'__dycall'));
456
-			array_push($fx,TComponent::GLOBAL_RAISE_EVENT_LISTENER);
454
+		if(is_a($this, 'IDynamicMethods')) {
455
+			$this->detachEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER, array($this, '__dycall'));
456
+			array_push($fx, TComponent::GLOBAL_RAISE_EVENT_LISTENER);
457 457
 		}
458 458
 
459 459
 		$this->_listeningenabled=false;
@@ -499,67 +499,67 @@  discard block
 block discarded – undo
499 499
 	public function __call($method, $args)
500 500
 	{
501 501
 		// don't mess with magic methods
502
-		if(strncasecmp($method,'__',2)===0)
502
+		if(strncasecmp($method, '__', 2)===0)
503 503
 			return;
504 504
 
505
-		$getset=substr($method,0,3);
506
-		if(($getset=='get')||($getset=='set'))
505
+		$getset=substr($method, 0, 3);
506
+		if(($getset=='get') || ($getset=='set'))
507 507
 		{
508
-			$propname=substr($method,3);
508
+			$propname=substr($method, 3);
509 509
 			$jsmethod=$getset.'js'.$propname;
510
-			if(method_exists($this,$jsmethod))
510
+			if(method_exists($this, $jsmethod))
511 511
 			{
512
-				if(count($args)>0)
513
-					if($args[0]&&!($args[0] instanceof TJavaScriptString))
512
+				if(count($args) > 0)
513
+					if($args[0] && !($args[0] instanceof TJavaScriptString))
514 514
 						$args[0]=new TJavaScriptString($args[0]);
515
-				return call_user_func_array(array($this,$jsmethod),$args);
515
+				return call_user_func_array(array($this, $jsmethod), $args);
516 516
 			}
517 517
 
518
-			if (($getset=='set')&&method_exists($this,'getjs'.$propname))
519
-				throw new TInvalidOperationException('component_property_readonly',get_class($this),$method);
518
+			if(($getset=='set') && method_exists($this, 'getjs'.$propname))
519
+				throw new TInvalidOperationException('component_property_readonly', get_class($this), $method);
520 520
 		}
521 521
 
522
-		if($this->_m!==null&&$this->_behaviorsenabled)
522
+		if($this->_m!==null && $this->_behaviorsenabled)
523 523
 		{
524
-			if(strncasecmp($method,'dy',2)===0)
524
+			if(strncasecmp($method, 'dy', 2)===0)
525 525
 			{
526 526
 				$callchain=new TCallChain($method);
527 527
 				foreach($this->_m->toArray() as $behavior)
528 528
 				{
529
-					if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&(method_exists($behavior,$method)||($behavior instanceof IDynamicMethods)))
529
+					if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) && (method_exists($behavior, $method) || ($behavior instanceof IDynamicMethods)))
530 530
 					{
531 531
 						$behavior_args=$args;
532 532
 						if($behavior instanceof IClassBehavior)
533
-							array_unshift($behavior_args,$this);
534
-						$callchain->addCall(array($behavior,$method),$behavior_args);
533
+							array_unshift($behavior_args, $this);
534
+						$callchain->addCall(array($behavior, $method), $behavior_args);
535 535
 					}
536 536
 
537 537
 				}
538
-				if($callchain->getCount()>0)
539
-					return call_user_func_array(array($callchain,'call'),$args);
538
+				if($callchain->getCount() > 0)
539
+					return call_user_func_array(array($callchain, 'call'), $args);
540 540
 			}
541 541
 			else
542 542
 			{
543 543
 				foreach($this->_m->toArray() as $behavior)
544 544
 				{
545
-					if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&method_exists($behavior,$method))
545
+					if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) && method_exists($behavior, $method))
546 546
 					{
547 547
 						if($behavior instanceof IClassBehavior)
548
-							array_unshift($args,$this);
549
-						return call_user_func_array(array($behavior,$method),$args);
548
+							array_unshift($args, $this);
549
+						return call_user_func_array(array($behavior, $method), $args);
550 550
 					}
551 551
 				}
552 552
 			}
553 553
 		}
554 554
 
555
-		if(strncasecmp($method,'dy',2)===0||strncasecmp($method,'fx',2)===0)
555
+		if(strncasecmp($method, 'dy', 2)===0 || strncasecmp($method, 'fx', 2)===0)
556 556
 		{
557 557
 			if($this instanceof IDynamicMethods)
558
-				return $this->__dycall($method,$args);
559
-			return isset($args[0])?$args[0]:null;
558
+				return $this->__dycall($method, $args);
559
+			return isset($args[0]) ? $args[0] : null;
560 560
 		}
561 561
 
562
-		throw new TApplicationException('component_method_undefined',get_class($this),$method);
562
+		throw new TApplicationException('component_method_undefined', get_class($this), $method);
563 563
 	}
564 564
 
565 565
 
@@ -588,17 +588,17 @@  discard block
 block discarded – undo
588 588
 	 */
589 589
 	public function __get($name)
590 590
 	{
591
-		if(method_exists($this,$getter='get'.$name))
591
+		if(method_exists($this, $getter='get'.$name))
592 592
 		{
593 593
 			// getting a property
594 594
 			return $this->$getter();
595 595
 		}
596
-		else if(method_exists($this,$jsgetter='getjs'.$name))
596
+		else if(method_exists($this, $jsgetter='getjs'.$name))
597 597
 		{
598 598
 			// getting a javascript property
599
-			return (string)$this->$jsgetter();
599
+			return (string) $this->$jsgetter();
600 600
 		}
601
-		else if(strncasecmp($name,'on',2)===0 && method_exists($this,$name))
601
+		else if(strncasecmp($name, 'on', 2)===0 && method_exists($this, $name))
602 602
 		{
603 603
 			// getting an event (handler list)
604 604
 			$name=strtolower($name);
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 				$this->_e[$name]=new TPriorityList;
607 607
 			return $this->_e[$name];
608 608
 		}
609
-		else if(strncasecmp($name,'fx',2)===0)
609
+		else if(strncasecmp($name, 'fx', 2)===0)
610 610
 		{
611 611
 			// getting a global event (handler list)
612 612
 			$name=strtolower($name);
@@ -623,13 +623,13 @@  discard block
 block discarded – undo
623 623
 			{
624 624
 				foreach($this->_m->toArray() as $behavior)
625 625
 				{
626
-					if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&
627
-						(property_exists($behavior,$name)||$behavior->canGetProperty($name)||$behavior->hasEvent($name)))
626
+					if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) &&
627
+						(property_exists($behavior, $name) || $behavior->canGetProperty($name) || $behavior->hasEvent($name)))
628 628
 						return $behavior->$name;
629 629
 				}
630 630
 			}
631 631
 		}
632
-		throw new TInvalidOperationException('component_property_undefined',get_class($this),$name);
632
+		throw new TInvalidOperationException('component_property_undefined', get_class($this), $name);
633 633
 	}
634 634
 
635 635
 	/**
@@ -647,31 +647,31 @@  discard block
 block discarded – undo
647 647
 	 * @param mixed the property value or event handler
648 648
 	 * @throws TInvalidOperationException If the property is not defined or read-only.
649 649
 	 */
650
-	public function __set($name,$value)
650
+	public function __set($name, $value)
651 651
 	{
652
-		if(method_exists($this,$setter='set'.$name))
652
+		if(method_exists($this, $setter='set'.$name))
653 653
 		{
654
-			if(strncasecmp($name,'js',2)===0&&$value&&!($value instanceof TJavaScriptLiteral))
655
-				$value = new TJavaScriptLiteral($value);
654
+			if(strncasecmp($name, 'js', 2)===0 && $value && !($value instanceof TJavaScriptLiteral))
655
+				$value=new TJavaScriptLiteral($value);
656 656
 			return $this->$setter($value);
657 657
 		}
658
-		else if(method_exists($this,$jssetter='setjs'.$name))
658
+		else if(method_exists($this, $jssetter='setjs'.$name))
659 659
 		{
660
-			if($value&&!($value instanceof TJavaScriptString))
660
+			if($value && !($value instanceof TJavaScriptString))
661 661
 				$value=new TJavaScriptString($value);
662 662
 			return $this->$jssetter($value);
663 663
 		}
664
-		else if((strncasecmp($name,'on',2)===0&&method_exists($this,$name))||strncasecmp($name,'fx',2)===0)
664
+		else if((strncasecmp($name, 'on', 2)===0 && method_exists($this, $name)) || strncasecmp($name, 'fx', 2)===0)
665 665
 		{
666
-			return $this->attachEventHandler($name,$value);
666
+			return $this->attachEventHandler($name, $value);
667 667
 		}
668
-		else if($this->_m!==null&&$this->_m->getCount()>0&&$this->_behaviorsenabled)
668
+		else if($this->_m!==null && $this->_m->getCount() > 0 && $this->_behaviorsenabled)
669 669
 		{
670 670
 			$sets=0;
671 671
 			foreach($this->_m->toArray() as $behavior)
672 672
 			{
673
-				if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&
674
-					(property_exists($behavior,$name)||$behavior->canSetProperty($name)||$behavior->hasEvent($name))) {
673
+				if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) &&
674
+					(property_exists($behavior, $name) || $behavior->canSetProperty($name) || $behavior->hasEvent($name))) {
675 675
 					$behavior->$name=$value;
676 676
 					$sets++;
677 677
 				}
@@ -680,13 +680,13 @@  discard block
 block discarded – undo
680 680
 
681 681
 		}
682 682
 
683
-		if(method_exists($this,'get'.$name)||method_exists($this,'getjs'.$name))
683
+		if(method_exists($this, 'get'.$name) || method_exists($this, 'getjs'.$name))
684 684
 		{
685
-			throw new TInvalidOperationException('component_property_readonly',get_class($this),$name);
685
+			throw new TInvalidOperationException('component_property_readonly', get_class($this), $name);
686 686
 		}
687 687
 		else
688 688
 		{
689
-			throw new TInvalidOperationException('component_property_undefined',get_class($this),$name);
689
+			throw new TInvalidOperationException('component_property_undefined', get_class($this), $name);
690 690
 		}
691 691
 	}
692 692
 
@@ -704,27 +704,27 @@  discard block
 block discarded – undo
704 704
 	 */
705 705
 	public function __isset($name)
706 706
 	{
707
-		if(method_exists($this,$getter='get'.$name))
707
+		if(method_exists($this, $getter='get'.$name))
708 708
 			return $this->$getter()!==null;
709
-		else if(method_exists($this,$jsgetter='getjs'.$name))
709
+		else if(method_exists($this, $jsgetter='getjs'.$name))
710 710
 			return $this->$jsgetter()!==null;
711
-		else if(strncasecmp($name,'on',2)===0&&method_exists($this,$name))
711
+		else if(strncasecmp($name, 'on', 2)===0 && method_exists($this, $name))
712 712
 		{
713 713
 			$name=strtolower($name);
714
-			return isset($this->_e[$name])&&$this->_e[$name]->getCount();
714
+			return isset($this->_e[$name]) && $this->_e[$name]->getCount();
715 715
 		}
716
-		else if(strncasecmp($name,'fx',2)===0)
716
+		else if(strncasecmp($name, 'fx', 2)===0)
717 717
 		{
718 718
 			$name=strtolower($name);
719
-			return isset(self::$_ue[$name])&&self::$_ue[$name]->getCount();
719
+			return isset(self::$_ue[$name]) && self::$_ue[$name]->getCount();
720 720
 		}
721
-		else if($this->_m!==null&&$this->_m->getCount()>0&&$this->_behaviorsenabled)
721
+		else if($this->_m!==null && $this->_m->getCount() > 0 && $this->_behaviorsenabled)
722 722
 		{
723 723
 			if(isset($this->_m[$name]))
724 724
 				return true;
725 725
 			foreach($this->_m->toArray() as $behavior)
726 726
 			{
727
-				if((!($behavior instanceof IBehavior)||$behavior->getEnabled()))
727
+				if((!($behavior instanceof IBehavior) || $behavior->getEnabled()))
728 728
 					return isset($behavior->$name);
729 729
 			}
730 730
 
@@ -745,15 +745,15 @@  discard block
 block discarded – undo
745 745
 	 */
746 746
 	public function __unset($name)
747 747
 	{
748
-		if(method_exists($this,$setter='set'.$name))
748
+		if(method_exists($this, $setter='set'.$name))
749 749
 			$this->$setter(null);
750
-		else if(method_exists($this,$jssetter='setjs'.$name))
750
+		else if(method_exists($this, $jssetter='setjs'.$name))
751 751
 			$this->$jssetter(null);
752
-		else if(strncasecmp($name,'on',2)===0&&method_exists($this,$name))
752
+		else if(strncasecmp($name, 'on', 2)===0 && method_exists($this, $name))
753 753
 			$this->_e[strtolower($name)]->clear();
754
-		else if(strncasecmp($name,'fx',2)===0)
754
+		else if(strncasecmp($name, 'fx', 2)===0)
755 755
 			$this->getEventHandlers($name)->remove(array($this, $name));
756
-		else if($this->_m!==null&&$this->_m->getCount()>0&&$this->_behaviorsenabled)
756
+		else if($this->_m!==null && $this->_m->getCount() > 0 && $this->_behaviorsenabled)
757 757
 		{
758 758
 			if(isset($this->_m[$name]))
759 759
 				$this->detachBehavior($name);
@@ -761,16 +761,16 @@  discard block
 block discarded – undo
761 761
 				$unset=0;
762 762
 				foreach($this->_m->toArray() as $behavior)
763 763
 				{
764
-					if((!($behavior instanceof IBehavior)||$behavior->getEnabled())) {
764
+					if((!($behavior instanceof IBehavior) || $behavior->getEnabled())) {
765 765
 						unset($behavior->$name);
766 766
 						$unset++;
767 767
 					}
768 768
 				}
769
-				if(!$unset&&method_exists($this,'get'.$name))
770
-					throw new TInvalidOperationException('component_property_readonly',get_class($this),$name);
769
+				if(!$unset && method_exists($this, 'get'.$name))
770
+					throw new TInvalidOperationException('component_property_readonly', get_class($this), $name);
771 771
 			}
772
-		} else if(method_exists($this,'get'.$name))
773
-			throw new TInvalidOperationException('component_property_readonly',get_class($this),$name);
772
+		} else if(method_exists($this, 'get'.$name))
773
+			throw new TInvalidOperationException('component_property_readonly', get_class($this), $name);
774 774
 	}
775 775
 
776 776
 	/**
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 	 */
783 783
 	public function hasProperty($name)
784 784
 	{
785
-		return $this->canGetProperty($name)||$this->canSetProperty($name);
785
+		return $this->canGetProperty($name) || $this->canSetProperty($name);
786 786
 	}
787 787
 
788 788
 	/**
@@ -796,13 +796,13 @@  discard block
 block discarded – undo
796 796
 	 */
797 797
 	public function canGetProperty($name)
798 798
 	{
799
-		if(method_exists($this,'get'.$name)||method_exists($this,'getjs'.$name))
799
+		if(method_exists($this, 'get'.$name) || method_exists($this, 'getjs'.$name))
800 800
 			return true;
801
-		else if($this->_m!==null&&$this->_behaviorsenabled)
801
+		else if($this->_m!==null && $this->_behaviorsenabled)
802 802
 		{
803 803
 			foreach($this->_m->toArray() as $behavior)
804 804
 			{
805
-				if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->canGetProperty($name))
805
+				if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) && $behavior->canGetProperty($name))
806 806
 					return true;
807 807
 			}
808 808
 		}
@@ -820,13 +820,13 @@  discard block
 block discarded – undo
820 820
 	 */
821 821
 	public function canSetProperty($name)
822 822
 	{
823
-		if(method_exists($this,'set'.$name)||method_exists($this,'setjs'.$name))
823
+		if(method_exists($this, 'set'.$name) || method_exists($this, 'setjs'.$name))
824 824
 			return true;
825
-		else if($this->_m!==null&&$this->_behaviorsenabled)
825
+		else if($this->_m!==null && $this->_behaviorsenabled)
826 826
 		{
827 827
 			foreach($this->_m->toArray() as $behavior)
828 828
 			{
829
-				if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->canSetProperty($name))
829
+				if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) && $behavior->canSetProperty($name))
830 830
 					return true;
831 831
 			}
832 832
 		}
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 	public function getSubProperty($path)
847 847
 	{
848 848
 		$object=$this;
849
-		foreach(explode('.',$path) as $property)
849
+		foreach(explode('.', $path) as $property)
850 850
 			$object=$object->$property;
851 851
 		return $object;
852 852
 	}
@@ -861,15 +861,15 @@  discard block
 block discarded – undo
861 861
 	 * @param string property path
862 862
 	 * @param mixed the property path value
863 863
 	 */
864
-	public function setSubProperty($path,$value)
864
+	public function setSubProperty($path, $value)
865 865
 	{
866 866
 		$object=$this;
867
-		if(($pos=strrpos($path,'.'))===false)
867
+		if(($pos=strrpos($path, '.'))===false)
868 868
 			$property=$path;
869 869
 		else
870 870
 		{
871
-			$object=$this->getSubProperty(substr($path,0,$pos));
872
-			$property=substr($path,$pos+1);
871
+			$object=$this->getSubProperty(substr($path, 0, $pos));
872
+			$property=substr($path, $pos + 1);
873 873
 		}
874 874
 		$object->$property=$value;
875 875
 	}
@@ -888,14 +888,14 @@  discard block
 block discarded – undo
888 888
 	 */
889 889
 	public function hasEvent($name)
890 890
 	{
891
-		if((strncasecmp($name,'on',2)===0&&method_exists($this,$name))||strncasecmp($name,'fx',2)===0||strncasecmp($name,'dy',2)===0)
891
+		if((strncasecmp($name, 'on', 2)===0 && method_exists($this, $name)) || strncasecmp($name, 'fx', 2)===0 || strncasecmp($name, 'dy', 2)===0)
892 892
 			return true;
893 893
 
894
-		else if($this->_m!==null&&$this->_behaviorsenabled)
894
+		else if($this->_m!==null && $this->_behaviorsenabled)
895 895
 		{
896 896
 			foreach($this->_m->toArray() as $behavior)
897 897
 			{
898
-				if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->hasEvent($name))
898
+				if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) && $behavior->hasEvent($name))
899 899
 					return true;
900 900
 			}
901 901
 		}
@@ -912,16 +912,16 @@  discard block
 block discarded – undo
912 912
 	public function hasEventHandler($name)
913 913
 	{
914 914
 		$name=strtolower($name);
915
-		if(strncasecmp($name,'fx',2)===0)
916
-			return isset(self::$_ue[$name])&&self::$_ue[$name]->getCount()>0;
915
+		if(strncasecmp($name, 'fx', 2)===0)
916
+			return isset(self::$_ue[$name]) && self::$_ue[$name]->getCount() > 0;
917 917
 		else
918 918
 		{
919
-			if(isset($this->_e[$name])&&$this->_e[$name]->getCount()>0)
919
+			if(isset($this->_e[$name]) && $this->_e[$name]->getCount() > 0)
920 920
 				return true;
921
-			else if($this->_m!==null&&$this->_behaviorsenabled) {
921
+			else if($this->_m!==null && $this->_behaviorsenabled) {
922 922
 				foreach($this->_m->toArray() as $behavior)
923 923
 				{
924
-					if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->hasEventHandler($name))
924
+					if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) && $behavior->hasEventHandler($name))
925 925
 						return true;
926 926
 				}
927 927
 			}
@@ -937,29 +937,29 @@  discard block
 block discarded – undo
937 937
 	 */
938 938
 	public function getEventHandlers($name)
939 939
 	{
940
-		if(strncasecmp($name,'on',2)===0&&method_exists($this,$name))
940
+		if(strncasecmp($name, 'on', 2)===0 && method_exists($this, $name))
941 941
 		{
942 942
 			$name=strtolower($name);
943 943
 			if(!isset($this->_e[$name]))
944 944
 				$this->_e[$name]=new TPriorityList;
945 945
 			return $this->_e[$name];
946 946
 		}
947
-		else if(strncasecmp($name,'fx',2)===0)
947
+		else if(strncasecmp($name, 'fx', 2)===0)
948 948
 		{
949 949
 			$name=strtolower($name);
950 950
 			if(!isset(self::$_ue[$name]))
951 951
 				self::$_ue[$name]=new TPriorityList;
952 952
 			return self::$_ue[$name];
953 953
 		}
954
-		else if($this->_m!==null&&$this->_behaviorsenabled)
954
+		else if($this->_m!==null && $this->_behaviorsenabled)
955 955
 		{
956 956
 			foreach($this->_m->toArray() as $behavior)
957 957
 			{
958
-				if((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->hasEvent($name))
958
+				if((!($behavior instanceof IBehavior) || $behavior->getEnabled()) && $behavior->hasEvent($name))
959 959
 					return $behavior->getEventHandlers($name);
960 960
 			}
961 961
 		}
962
-		throw new TInvalidOperationException('component_event_undefined',get_class($this),$name);
962
+		throw new TInvalidOperationException('component_event_undefined', get_class($this), $name);
963 963
 	}
964 964
 
965 965
 	/**
@@ -1007,9 +1007,9 @@  discard block
 block discarded – undo
1007 1007
 	 * default priority of 10.0 within {@link TPriorityList}
1008 1008
 	 * @throws TInvalidOperationException if the event does not exist
1009 1009
 	 */
1010
-	public function attachEventHandler($name,$handler,$priority=null)
1010
+	public function attachEventHandler($name, $handler, $priority=null)
1011 1011
 	{
1012
-		$this->getEventHandlers($name)->add($handler,$priority);
1012
+		$this->getEventHandlers($name)->add($handler, $priority);
1013 1013
 	}
1014 1014
 
1015 1015
 	/**
@@ -1022,13 +1022,13 @@  discard block
 block discarded – undo
1022 1022
 	 * to an item of any priority within {@link TPriorityList}; null means the default priority
1023 1023
 	 * @return boolean if the removal is successful
1024 1024
 	 */
1025
-	public function detachEventHandler($name,$handler,$priority=false)
1025
+	public function detachEventHandler($name, $handler, $priority=false)
1026 1026
 	{
1027 1027
 		if($this->hasEventHandler($name))
1028 1028
 		{
1029 1029
 			try
1030 1030
 			{
1031
-				$this->getEventHandlers($name)->remove($handler,$priority);
1031
+				$this->getEventHandlers($name)->remove($handler, $priority);
1032 1032
 				return true;
1033 1033
 			}
1034 1034
 			catch(Exception $e)
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 	 * @throws TInvalidOperationException if the event is undefined
1111 1111
 	 * @throws TInvalidDataValueException If an event handler is invalid
1112 1112
 	 */
1113
-	public function raiseEvent($name,$sender,$param,$responsetype=null,$postfunction=null)
1113
+	public function raiseEvent($name, $sender, $param, $responsetype=null, $postfunction=null)
1114 1114
 	{
1115 1115
 		$p=$param;
1116 1116
 		if(is_callable($responsetype))
@@ -1125,90 +1125,90 @@  discard block
 block discarded – undo
1125 1125
 		$name=strtolower($name);
1126 1126
 		$responses=array();
1127 1127
 
1128
-		$name=$this->dyPreRaiseEvent($name,$sender,$param,$responsetype,$postfunction);
1128
+		$name=$this->dyPreRaiseEvent($name, $sender, $param, $responsetype, $postfunction);
1129 1129
 
1130
-		if($this->hasEventHandler($name)||$this->hasEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER))
1130
+		if($this->hasEventHandler($name) || $this->hasEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER))
1131 1131
 		{
1132 1132
 			$handlers=$this->getEventHandlers($name);
1133 1133
 			$handlerArray=$handlers->toArray();
1134
-			if(strncasecmp($name,'fx',2)===0&&$this->hasEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER))
1134
+			if(strncasecmp($name, 'fx', 2)===0 && $this->hasEventHandler(TComponent::GLOBAL_RAISE_EVENT_LISTENER))
1135 1135
 			{
1136 1136
 				$globalhandlers=$this->getEventHandlers(TComponent::GLOBAL_RAISE_EVENT_LISTENER);
1137
-				$handlerArray=array_merge($globalhandlers->toArrayBelowPriority(0),$handlerArray,$globalhandlers->toArrayAbovePriority(0));
1137
+				$handlerArray=array_merge($globalhandlers->toArrayBelowPriority(0), $handlerArray, $globalhandlers->toArrayAbovePriority(0));
1138 1138
 			}
1139 1139
 			$response=null;
1140 1140
 			foreach($handlerArray as $handler)
1141 1141
 			{
1142
-				if($this->dyIntraRaiseEventTestHandler($handler,$sender,$param,$name)===false)
1142
+				if($this->dyIntraRaiseEventTestHandler($handler, $sender, $param, $name)===false)
1143 1143
 					continue;
1144 1144
 
1145 1145
 				if(is_string($handler))
1146 1146
 				{
1147
-					if(($pos=strrpos($handler,'.'))!==false)
1147
+					if(($pos=strrpos($handler, '.'))!==false)
1148 1148
 					{
1149
-						$object=$this->getSubProperty(substr($handler,0,$pos));
1150
-						$method=substr($handler,$pos+1);
1151
-						if(method_exists($object,$method)||strncasecmp($method,'dy',2)===0||strncasecmp($method,'fx',2)===0)
1149
+						$object=$this->getSubProperty(substr($handler, 0, $pos));
1150
+						$method=substr($handler, $pos + 1);
1151
+						if(method_exists($object, $method) || strncasecmp($method, 'dy', 2)===0 || strncasecmp($method, 'fx', 2)===0)
1152 1152
 						{
1153 1153
 							if($method=='__dycall')
1154
-								$response=$object->__dycall($name,array($sender,$param,$name));
1154
+								$response=$object->__dycall($name, array($sender, $param, $name));
1155 1155
 							else
1156
-								$response=$object->$method($sender,$param,$name);
1156
+								$response=$object->$method($sender, $param, $name);
1157 1157
 						}
1158 1158
 						else
1159
-							throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name,$handler);
1159
+							throw new TInvalidDataValueException('component_eventhandler_invalid', get_class($this), $name, $handler);
1160 1160
 					}
1161 1161
 					else
1162
-						$response=call_user_func($handler,$sender,$param,$name);
1162
+						$response=call_user_func($handler, $sender, $param, $name);
1163 1163
 				}
1164
-				else if(is_callable($handler,true))
1164
+				else if(is_callable($handler, true))
1165 1165
 				{
1166
-					list($object,$method)=$handler;
1166
+					list($object, $method)=$handler;
1167 1167
 					if(is_string($object))
1168
-						$response=call_user_func($handler,$sender,$param,$name);
1168
+						$response=call_user_func($handler, $sender, $param, $name);
1169 1169
 					else
1170 1170
 					{
1171
-						if(($pos=strrpos($method,'.'))!==false)
1171
+						if(($pos=strrpos($method, '.'))!==false)
1172 1172
 						{
1173
-							$object=$this->getSubProperty(substr($method,0,$pos));
1174
-							$method=substr($method,$pos+1);
1173
+							$object=$this->getSubProperty(substr($method, 0, $pos));
1174
+							$method=substr($method, $pos + 1);
1175 1175
 						}
1176
-						if(method_exists($object,$method)||strncasecmp($method,'dy',2)===0||strncasecmp($method,'fx',2)===0)
1176
+						if(method_exists($object, $method) || strncasecmp($method, 'dy', 2)===0 || strncasecmp($method, 'fx', 2)===0)
1177 1177
 						{
1178 1178
 							if($method=='__dycall')
1179
-								$response=$object->__dycall($name,array($sender,$param,$name));
1179
+								$response=$object->__dycall($name, array($sender, $param, $name));
1180 1180
 							else
1181
-								$response=$object->$method($sender,$param,$name);
1181
+								$response=$object->$method($sender, $param, $name);
1182 1182
 						}
1183 1183
 						else
1184
-							throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name,$handler[1]);
1184
+							throw new TInvalidDataValueException('component_eventhandler_invalid', get_class($this), $name, $handler[1]);
1185 1185
 					}
1186 1186
 				}
1187 1187
 				else
1188
-					throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name,gettype($handler));
1188
+					throw new TInvalidDataValueException('component_eventhandler_invalid', get_class($this), $name, gettype($handler));
1189 1189
 
1190
-				$this->dyIntraRaiseEventPostHandler($name,$sender,$param,$handler,$response);
1190
+				$this->dyIntraRaiseEventPostHandler($name, $sender, $param, $handler, $response);
1191 1191
 
1192 1192
 				if($postfunction)
1193
-					$response=call_user_func_array($postfunction,array($sender,$param,$this,$response));
1193
+					$response=call_user_func_array($postfunction, array($sender, $param, $this, $response));
1194 1194
 
1195
-				if($responsetype&TEventResults::EVENT_RESULT_ALL)
1196
-					$responses[]=array('sender'=>$sender,'param'=>$param,'response'=>$response);
1195
+				if($responsetype & TEventResults::EVENT_RESULT_ALL)
1196
+					$responses[]=array('sender'=>$sender, 'param'=>$param, 'response'=>$response);
1197 1197
 				else
1198 1198
 					$responses[]=$response;
1199 1199
 
1200
-				if($response!==null&&($responsetype&TEventResults::EVENT_RESULT_FEED_FORWARD))
1200
+				if($response!==null && ($responsetype & TEventResults::EVENT_RESULT_FEED_FORWARD))
1201 1201
 					$param=$response;
1202 1202
 
1203 1203
 			}
1204 1204
 		}
1205
-		else if(strncasecmp($name,'on',2)===0&&!$this->hasEvent($name))
1206
-			throw new TInvalidOperationException('component_event_undefined',get_class($this),$name);
1205
+		else if(strncasecmp($name, 'on', 2)===0 && !$this->hasEvent($name))
1206
+			throw new TInvalidOperationException('component_event_undefined', get_class($this), $name);
1207 1207
 
1208
-		if($responsetype&TEventResults::EVENT_RESULT_FILTER)
1208
+		if($responsetype & TEventResults::EVENT_RESULT_FILTER)
1209 1209
 			$responses=array_filter($responses);
1210 1210
 
1211
-		$responses=$this->dyPostRaiseEvent($responses,$name,$sender,$param,$responsetype,$postfunction);
1211
+		$responses=$this->dyPostRaiseEvent($responses, $name, $sender, $param, $responsetype, $postfunction);
1212 1212
 
1213 1213
 		return $responses;
1214 1214
 	}
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
 		}
1242 1242
 		catch(Exception $e)
1243 1243
 		{
1244
-			throw new TInvalidOperationException('component_expression_invalid',get_class($this),$expression,$e->getMessage());
1244
+			throw new TInvalidOperationException('component_expression_invalid', get_class($this), $expression, $e->getMessage());
1245 1245
 		}
1246 1246
 	}
1247 1247
 
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 		}
1277 1277
 		catch(Exception $e)
1278 1278
 		{
1279
-			throw new TInvalidOperationException('component_statements_invalid',get_class($this),$statements,$e->getMessage());
1279
+			throw new TInvalidOperationException('component_statements_invalid', get_class($this), $statements, $e->getMessage());
1280 1280
 		}
1281 1281
 	}
1282 1282
 
@@ -1336,9 +1336,9 @@  discard block
 block discarded – undo
1336 1336
 	 * @param $param TClassBehaviorEventParameter
1337 1337
 	 * @since 3.2.3
1338 1338
 	 */
1339
-	public function fxAttachClassBehavior($sender,$param) {
1340
-		if(in_array($param->getClass(),$this->getClassHierarchy(true)))
1341
-			return $this->attachBehavior($param->getName(),$param->getBehavior(),$param->getPriority());
1339
+	public function fxAttachClassBehavior($sender, $param) {
1340
+		if(in_array($param->getClass(), $this->getClassHierarchy(true)))
1341
+			return $this->attachBehavior($param->getName(), $param->getBehavior(), $param->getPriority());
1342 1342
 	}
1343 1343
 
1344 1344
 
@@ -1350,9 +1350,9 @@  discard block
 block discarded – undo
1350 1350
 	 * @param $param TClassBehaviorEventParameter
1351 1351
 	 * @since 3.2.3
1352 1352
 	 */
1353
-	public function fxDetachClassBehavior($sender,$param) {
1354
-		if(in_array($param->getClass(),$this->getClassHierarchy(true)))
1355
-			return $this->detachBehavior($param->getName(),$param->getPriority());
1353
+	public function fxDetachClassBehavior($sender, $param) {
1354
+		if(in_array($param->getClass(), $this->getClassHierarchy(true)))
1355
+			return $this->detachBehavior($param->getName(), $param->getPriority());
1356 1356
 	}
1357 1357
 
1358 1358
 
@@ -1374,8 +1374,8 @@  discard block
 block discarded – undo
1374 1374
 	 * @throws TInvalidOperationException if the class behavior is already defined
1375 1375
 	 * @since 3.2.3
1376 1376
 	 */
1377
-	public static function attachClassBehavior($name,$behavior,$class=null,$priority=null) {
1378
-		if(!$class&&function_exists('get_called_class'))
1377
+	public static function attachClassBehavior($name, $behavior, $class=null, $priority=null) {
1378
+		if(!$class && function_exists('get_called_class'))
1379 1379
 			$class=get_called_class();
1380 1380
 		if(!$class)
1381 1381
 			throw new TInvalidOperationException('component_no_class_provided_nor_late_binding');
@@ -1388,11 +1388,11 @@  discard block
 block discarded – undo
1388 1388
 		if(empty(self::$_um[$class]))
1389 1389
 			self::$_um[$class]=array();
1390 1390
 		if(isset(self::$_um[$class][$name]))
1391
-			throw new TInvalidOperationException('component_class_behavior_defined',$class,$name);
1392
-		$param=new TClassBehaviorEventParameter($class,$name,$behavior,$priority);
1393
-		self::$_um[$class]=array($name=>$param)+self::$_um[$class];
1394
-		$behaviorObject=is_string($behavior)?new $behavior:$behavior;
1395
-		return $behaviorObject->raiseEvent('fxAttachClassBehavior',null,$param);
1391
+			throw new TInvalidOperationException('component_class_behavior_defined', $class, $name);
1392
+		$param=new TClassBehaviorEventParameter($class, $name, $behavior, $priority);
1393
+		self::$_um[$class]=array($name=>$param) + self::$_um[$class];
1394
+		$behaviorObject=is_string($behavior) ? new $behavior : $behavior;
1395
+		return $behaviorObject->raiseEvent('fxAttachClassBehavior', null, $param);
1396 1396
 	}
1397 1397
 
1398 1398
 
@@ -1408,8 +1408,8 @@  discard block
 block discarded – undo
1408 1408
 	 * not supplied as a parameter.
1409 1409
 	 * @since 3.2.3
1410 1410
 	 */
1411
-	public static function detachClassBehavior($name,$class=null,$priority=false) {
1412
-		if(!$class&&function_exists('get_called_class'))
1411
+	public static function detachClassBehavior($name, $class=null, $priority=false) {
1412
+		if(!$class && function_exists('get_called_class'))
1413 1413
 			$class=get_called_class();
1414 1414
 		if(!$class)
1415 1415
 			throw new TInvalidOperationException('component_no_class_provided_nor_late_binding');
@@ -1417,13 +1417,13 @@  discard block
 block discarded – undo
1417 1417
 		$class=strtolower($class);
1418 1418
 		if(!is_string($name))
1419 1419
 			$name=get_class($name);
1420
-		if(empty(self::$_um[$class])||!isset(self::$_um[$class][$name]))
1420
+		if(empty(self::$_um[$class]) || !isset(self::$_um[$class][$name]))
1421 1421
 			return false;
1422 1422
 		$param=self::$_um[$class][$name];
1423 1423
 		$behavior=$param->getBehavior();
1424 1424
 		unset(self::$_um[$class][$name]);
1425
-		$behaviorObject=is_string($behavior)?new $behavior:$behavior;
1426
-		return $behaviorObject->raiseEvent('fxDetachClassBehavior',null,$param);
1425
+		$behaviorObject=is_string($behavior) ? new $behavior : $behavior;
1426
+		return $behaviorObject->raiseEvent('fxDetachClassBehavior', null, $param);
1427 1427
 	}
1428 1428
 
1429 1429
 	/**
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
 	 */
1436 1436
 	public function asa($behaviorname)
1437 1437
 	{
1438
-		return isset($this->_m[$behaviorname])?$this->_m[$behaviorname]:null;
1438
+		return isset($this->_m[$behaviorname]) ? $this->_m[$behaviorname] : null;
1439 1439
 	}
1440 1440
 
1441 1441
 	/**
@@ -1461,15 +1461,15 @@  discard block
 block discarded – undo
1461 1461
 	{
1462 1462
 		if($this instanceof $class)
1463 1463
 			return true;
1464
-		if($this->_m!==null&&$this->_behaviorsenabled)
1465
-			foreach($this->_m->toArray() as $behavior){
1466
-				if(($behavior instanceof IBehavior)&&!$behavior->getEnabled())
1464
+		if($this->_m!==null && $this->_behaviorsenabled)
1465
+			foreach($this->_m->toArray() as $behavior) {
1466
+				if(($behavior instanceof IBehavior) && !$behavior->getEnabled())
1467 1467
 					continue;
1468 1468
 
1469
-				$check = null;
1470
-				if(($behavior->isa('IInstanceCheck'))&&$check=$behavior->isinstanceof($class,$this))
1469
+				$check=null;
1470
+				if(($behavior->isa('IInstanceCheck')) && $check=$behavior->isinstanceof($class, $this))
1471 1471
 					return true;
1472
-				if($check===null&&($behavior->isa($class)))
1472
+				if($check===null && ($behavior->isa($class)))
1473 1473
 					return true;
1474 1474
 			}
1475 1475
 		return false;
@@ -1487,9 +1487,9 @@  discard block
 block discarded – undo
1487 1487
 	{
1488 1488
 		foreach($behaviors as $name=>$behavior)
1489 1489
 			if($behavior instanceof TClassBehaviorEventParameter)
1490
-				$this->attachBehavior($behavior->getName(),$behavior->getBehavior(),$behavior->getPriority());
1490
+				$this->attachBehavior($behavior->getName(), $behavior->getBehavior(), $behavior->getPriority());
1491 1491
 			else
1492
-				$this->attachBehavior($name,$behavior);
1492
+				$this->attachBehavior($name, $behavior);
1493 1493
 	}
1494 1494
 
1495 1495
 	/**
@@ -1506,9 +1506,9 @@  discard block
 block discarded – undo
1506 1506
 		{
1507 1507
 			foreach($behaviors as $name=>$behavior)
1508 1508
 				if($behavior instanceof TClassBehaviorEventParameter)
1509
-					$this->detachBehavior($behavior->getName(),$behavior->getPriority());
1509
+					$this->detachBehavior($behavior->getName(), $behavior->getPriority());
1510 1510
 				else
1511
-					$this->detachBehavior(is_string($behavior)?$behavior:$name);
1511
+					$this->detachBehavior(is_string($behavior) ? $behavior : $name);
1512 1512
 		}
1513 1513
 	}
1514 1514
 
@@ -1546,19 +1546,19 @@  discard block
 block discarded – undo
1546 1546
 	 * @return IBehavior the behavior object
1547 1547
 	 * @since 3.2.3
1548 1548
 	 */
1549
-	public function attachBehavior($name,$behavior,$priority=null)
1549
+	public function attachBehavior($name, $behavior, $priority=null)
1550 1550
 	{
1551 1551
 		if(is_string($behavior))
1552 1552
 			$behavior=Prado::createComponent($behavior);
1553 1553
 		if(!($behavior instanceof IBaseBehavior))
1554
-			throw new TInvalidDataTypeException('component_not_a_behavior',get_class($behavior));
1554
+			throw new TInvalidDataTypeException('component_not_a_behavior', get_class($behavior));
1555 1555
 		if($behavior instanceof IBehavior)
1556 1556
 			$behavior->setEnabled(true);
1557 1557
 		if($this->_m===null)
1558 1558
 			$this->_m=new TPriorityMap;
1559 1559
 		$behavior->attach($this);
1560
-		$this->dyAttachBehavior($name,$behavior);
1561
-		$this->_m->add($name,$behavior,$priority);
1560
+		$this->dyAttachBehavior($name, $behavior);
1561
+		$this->_m->add($name, $behavior, $priority);
1562 1562
 		return $behavior;
1563 1563
 	}
1564 1564
 
@@ -1579,14 +1579,14 @@  discard block
 block discarded – undo
1579 1579
 	 * @return IBehavior the detached behavior. Null if the behavior does not exist.
1580 1580
 	 * @since 3.2.3
1581 1581
 	 */
1582
-	public function detachBehavior($name,$priority=false)
1582
+	public function detachBehavior($name, $priority=false)
1583 1583
 	{
1584
-		if($this->_m!=null&&isset($this->_m[$name]))
1584
+		if($this->_m!=null && isset($this->_m[$name]))
1585 1585
 		{
1586 1586
 			$this->_m[$name]->detach($this);
1587 1587
 			$behavior=$this->_m->itemAt($name);
1588
-			$this->_m->remove($name,$priority);
1589
-			$this->dyDetachBehavior($name,$behavior);
1588
+			$this->_m->remove($name, $priority);
1589
+			$this->dyDetachBehavior($name, $behavior);
1590 1590
 			return $behavior;
1591 1591
 		}
1592 1592
 	}
@@ -1662,10 +1662,10 @@  discard block
 block discarded – undo
1662 1662
 	 */
1663 1663
 	public function enableBehavior($name)
1664 1664
 	{
1665
-		if($this->_m!=null&&isset($this->_m[$name])){
1665
+		if($this->_m!=null && isset($this->_m[$name])) {
1666 1666
 			if($this->_m[$name] instanceof IBehavior) {
1667 1667
 				$this->_m[$name]->setEnabled(true);
1668
-				$this->dyEnableBehavior($name,$this->_m[$name]);
1668
+				$this->dyEnableBehavior($name, $this->_m[$name]);
1669 1669
 				return true;
1670 1670
 			}
1671 1671
 			return false;
@@ -1690,10 +1690,10 @@  discard block
 block discarded – undo
1690 1690
 	 */
1691 1691
 	public function disableBehavior($name)
1692 1692
 	{
1693
-		if($this->_m!=null&&isset($this->_m[$name])){
1693
+		if($this->_m!=null && isset($this->_m[$name])) {
1694 1694
 			if($this->_m[$name] instanceof IBehavior) {
1695 1695
 				$this->_m[$name]->setEnabled(false);
1696
-				$this->dyDisableBehavior($name,$this->_m[$name]);
1696
+				$this->dyDisableBehavior($name, $this->_m[$name]);
1697 1697
 				return true;
1698 1698
 			}
1699 1699
 			return false;
@@ -1708,9 +1708,9 @@  discard block
 block discarded – undo
1708 1708
 	 */
1709 1709
 	public function __sleep()
1710 1710
 	{
1711
-		$a = (array)$this;
1712
-		$a = array_keys($a);
1713
-		$exprops = array();
1711
+		$a=(array) $this;
1712
+		$a=array_keys($a);
1713
+		$exprops=array();
1714 1714
 		$this->_getZappableSleepProps($exprops);
1715 1715
 		return array_diff($a, $exprops);
1716 1716
 	}
@@ -1724,13 +1724,13 @@  discard block
 block discarded – undo
1724 1724
 	protected function _getZappableSleepProps(&$exprops)
1725 1725
 	{
1726 1726
 		if($this->_listeningenabled===false)
1727
-			$exprops[] = "\0TComponent\0_listeningenabled";
1727
+			$exprops[]="\0TComponent\0_listeningenabled";
1728 1728
 		if($this->_behaviorsenabled===true)
1729
-			$exprops[] = "\0TComponent\0_behaviorsenabled";
1730
-		if ($this->_e===array())
1731
-			$exprops[] = "\0TComponent\0_e";
1732
-		if ($this->_m===null)
1733
-			$exprops[] = "\0TComponent\0_m";
1729
+			$exprops[]="\0TComponent\0_behaviorsenabled";
1730
+		if($this->_e===array())
1731
+			$exprops[]="\0TComponent\0_e";
1732
+		if($this->_m===null)
1733
+			$exprops[]="\0TComponent\0_m";
1734 1734
 	}
1735 1735
 }
1736 1736
 
@@ -1746,7 +1746,7 @@  discard block
 block discarded – undo
1746 1746
  */
1747 1747
 interface IDynamicMethods
1748 1748
 {
1749
-	public function __dycall($method,$args);
1749
+	public function __dycall($method, $args);
1750 1750
 }
1751 1751
 
1752 1752
 
@@ -1773,7 +1773,7 @@  discard block
 block discarded – undo
1773 1773
 	 *	@param string $name the name of the behavior
1774 1774
 	 *	@param object $behavior this is the behavior to implement the class behavior
1775 1775
 	 */
1776
-	public function __construct($class,$name,$behavior,$priority)
1776
+	public function __construct($class, $name, $behavior, $priority)
1777 1777
 	{
1778 1778
 		$this->_class=$class;
1779 1779
 		$this->_name=$name;
@@ -1914,10 +1914,10 @@  discard block
 block discarded – undo
1914 1914
 	 */
1915 1915
 	public static function ensureBoolean($value)
1916 1916
 	{
1917
-		if (is_string($value))
1918
-			return strcasecmp($value,'true')==0 || $value!=0;
1917
+		if(is_string($value))
1918
+			return strcasecmp($value, 'true')==0 || $value!=0;
1919 1919
 		else
1920
-			return (boolean)$value;
1920
+			return (boolean) $value;
1921 1921
 	}
1922 1922
 
1923 1923
 	/**
@@ -1929,12 +1929,12 @@  discard block
 block discarded – undo
1929 1929
 	 */
1930 1930
 	public static function ensureString($value)
1931 1931
 	{
1932
-		if (TJavaScript::isJsLiteral($value))
1932
+		if(TJavaScript::isJsLiteral($value))
1933 1933
 			return $value;
1934
-		if (is_bool($value))
1935
-			return $value?'true':'false';
1934
+		if(is_bool($value))
1935
+			return $value ? 'true' : 'false';
1936 1936
 		else
1937
-			return (string)$value;
1937
+			return (string) $value;
1938 1938
 	}
1939 1939
 
1940 1940
 	/**
@@ -1944,7 +1944,7 @@  discard block
 block discarded – undo
1944 1944
 	 */
1945 1945
 	public static function ensureInteger($value)
1946 1946
 	{
1947
-		return (integer)$value;
1947
+		return (integer) $value;
1948 1948
 	}
1949 1949
 
1950 1950
 	/**
@@ -1954,7 +1954,7 @@  discard block
 block discarded – undo
1954 1954
 	 */
1955 1955
 	public static function ensureFloat($value)
1956 1956
 	{
1957
-		return (float)$value;
1957
+		return (float) $value;
1958 1958
 	}
1959 1959
 
1960 1960
 	/**
@@ -1970,18 +1970,18 @@  discard block
 block discarded – undo
1970 1970
 	{
1971 1971
 		if(is_string($value))
1972 1972
 		{
1973
-			$value = trim($value);
1974
-			$len = strlen($value);
1975
-			if ($len >= 2 && $value[0] == '(' && $value[$len-1] == ')')
1973
+			$value=trim($value);
1974
+			$len=strlen($value);
1975
+			if($len >= 2 && $value[0]=='(' && $value[$len - 1]==')')
1976 1976
 			{
1977 1977
 				eval('$array=array'.$value.';');
1978 1978
 				return $array;
1979 1979
 			}
1980 1980
 			else
1981
-				return $len>0?array($value):array();
1981
+				return $len > 0 ? array($value) : array();
1982 1982
 		}
1983 1983
 		else
1984
-			return (array)$value;
1984
+			return (array) $value;
1985 1985
 	}
1986 1986
 
1987 1987
 	/**
@@ -1991,7 +1991,7 @@  discard block
 block discarded – undo
1991 1991
 	 */
1992 1992
 	public static function ensureObject($value)
1993 1993
 	{
1994
-		return (object)$value;
1994
+		return (object) $value;
1995 1995
 	}
1996 1996
 
1997 1997
 	/**
@@ -2010,7 +2010,7 @@  discard block
 block discarded – undo
2010 2010
 	 * @return string the valid enumeration value
2011 2011
 	 * @throws TInvalidDataValueException if the original value is not in the string array.
2012 2012
 	 */
2013
-	public static function ensureEnum($value,$enums)
2013
+	public static function ensureEnum($value, $enums)
2014 2014
 	{
2015 2015
 		static $types=array();
2016 2016
 		if(func_num_args()===2 && is_string($enums))
@@ -2021,18 +2021,18 @@  discard block
 block discarded – undo
2021 2021
 				return $value;
2022 2022
 			else
2023 2023
 				throw new TInvalidDataValueException(
2024
-					'propertyvalue_enumvalue_invalid',$value,
2025
-						implode(' | ',$types[$enums]->getConstants()));
2024
+					'propertyvalue_enumvalue_invalid', $value,
2025
+						implode(' | ', $types[$enums]->getConstants()));
2026 2026
 		}
2027 2027
 		else if(!is_array($enums))
2028 2028
 		{
2029 2029
 			$enums=func_get_args();
2030 2030
 			array_shift($enums);
2031 2031
 		}
2032
-		if(in_array($value,$enums,true))
2032
+		if(in_array($value, $enums, true))
2033 2033
 			return $value;
2034 2034
 		else
2035
-			throw new TInvalidDataValueException('propertyvalue_enumvalue_invalid',$value,implode(' | ',$enums));
2035
+			throw new TInvalidDataValueException('propertyvalue_enumvalue_invalid', $value, implode(' | ', $enums));
2036 2036
 	}
2037 2037
 
2038 2038
 	/**
@@ -2042,7 +2042,7 @@  discard block
 block discarded – undo
2042 2042
 	 */
2043 2043
 	public static function ensureNullIfEmpty($value)
2044 2044
 	{
2045
-		return empty($value)?null:$value;
2045
+		return empty($value) ? null : $value;
2046 2046
 	}
2047 2047
 }
2048 2048
 
@@ -2095,7 +2095,7 @@  discard block
 block discarded – undo
2095 2095
 	 */
2096 2096
 	public function __construct($component)
2097 2097
 	{
2098
-		if(is_string($component) && class_exists($component,false))
2098
+		if(is_string($component) && class_exists($component, false))
2099 2099
 			$this->_className=$component;
2100 2100
 		else if(is_object($component))
2101 2101
 			$this->_className=get_class($component);
@@ -2108,14 +2108,14 @@  discard block
 block discarded – undo
2108 2108
 	{
2109 2109
 		$methodName=$method->getName();
2110 2110
 		return $method->getNumberOfRequiredParameters()===0
2111
-				&& strncasecmp($methodName,'get',3)===0
2111
+				&& strncasecmp($methodName, 'get', 3)===0
2112 2112
 				&& isset($methodName[3]);
2113 2113
 	}
2114 2114
 
2115 2115
 	private function isEventMethod($method)
2116 2116
 	{
2117 2117
 		$methodName=$method->getName();
2118
-		return strncasecmp($methodName,'on',2)===0
2118
+		return strncasecmp($methodName, 'on', 2)===0
2119 2119
 				&& isset($methodName[2]);
2120 2120
 	}
2121 2121
 
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
 		$properties=array();
2126 2126
 		$events=array();
2127 2127
 		$methods=array();
2128
-		$isComponent=is_subclass_of($this->_className,'TComponent') || strcasecmp($this->_className,'TComponent')===0;
2128
+		$isComponent=is_subclass_of($this->_className, 'TComponent') || strcasecmp($this->_className, 'TComponent')===0;
2129 2129
 		foreach($class->getMethods() as $method)
2130 2130
 		{
2131 2131
 			if($method->isPublic() || $method->isProtected())
@@ -2134,14 +2134,14 @@  discard block
 block discarded – undo
2134 2134
 				if(!$method->isStatic() && $isComponent)
2135 2135
 				{
2136 2136
 					if($this->isPropertyMethod($method))
2137
-						$properties[substr($methodName,3)]=$method;
2137
+						$properties[substr($methodName, 3)]=$method;
2138 2138
 					else if($this->isEventMethod($method))
2139 2139
 					{
2140 2140
 						$methodName[0]='O';
2141 2141
 						$events[$methodName]=$method;
2142 2142
 					}
2143 2143
 				}
2144
-				if(strncmp($methodName,'__',2)!==0)
2144
+				if(strncmp($methodName, '__', 2)!==0)
2145 2145
 					$methods[$methodName]=$method;
2146 2146
 			}
2147 2147
 		}
@@ -2191,7 +2191,7 @@  discard block
 block discarded – undo
2191 2191
 	protected function determinePropertyType($method)
2192 2192
 	{
2193 2193
 		$comment=$method->getDocComment();
2194
-		if(preg_match('/@return\\s+(.*?)\\s+/',$comment,$matches))
2194
+		if(preg_match('/@return\\s+(.*?)\\s+/', $comment, $matches))
2195 2195
 			return $matches[1];
2196 2196
 		else
2197 2197
 			return '{unknown}';
@@ -2349,7 +2349,7 @@  discard block
 block discarded – undo
2349 2349
 	 * @return boolean|null if the this or the instance is of type class.  When null, no information could be derived and
2350 2350
 	 * the default mechanisms take over.
2351 2351
 	 */
2352
-	public function isinstanceof($class,$instance=null);
2352
+	public function isinstanceof($class, $instance=null);
2353 2353
 }
2354 2354
 
2355 2355
 /**
@@ -2379,12 +2379,12 @@  discard block
 block discarded – undo
2379 2379
 
2380 2380
 	public function __construct($s)
2381 2381
 	{
2382
-		$this->_s = $s;
2382
+		$this->_s=$s;
2383 2383
 	}
2384 2384
 
2385 2385
 	public function __toString()
2386 2386
 	{
2387
-		return (string)$this->_s;
2387
+		return (string) $this->_s;
2388 2388
 	}
2389 2389
 
2390 2390
 	public function toJavaScriptLiteral()
@@ -2404,7 +2404,7 @@  discard block
 block discarded – undo
2404 2404
 {
2405 2405
 	public function toJavaScriptLiteral()
2406 2406
 	{
2407
-		return TJavaScript::jsonEncode((string)$this->_s,JSON_HEX_QUOT | JSON_HEX_APOS | JSON_HEX_TAG);
2407
+		return TJavaScript::jsonEncode((string) $this->_s, JSON_HEX_QUOT | JSON_HEX_APOS | JSON_HEX_TAG);
2408 2408
 	}
2409 2409
 }
2410 2410
 
Please login to merge, or discard this patch.