root/components/codeReflection/CodeReflectionClass.class.php

614
5
	{
5
	{
6
		return array_pop( explode( "::" , parent::getName() ) );
6
		return array_pop( explode( "::" , parent::getName() ) );
7
	}
7
	}
8
	
8
9
	public function getNamespace()
9
	public function getNamespace()
10
	{
10
	{
11
		return array_shift( explode( "::" , parent::getName() ) );
11
		return array_shift( explode( "::" , parent::getName() ) );
12
	}
12
	}
13
	
13
14
	public function createClassDefinitionCode()
14
	public function createClassDefinitionCode()
15
	{
15
	{
16
		$strCode = "";
16
		$strCode = "";
17
		$strCode .= " class " . $this->getClassName();
17
		$strCode .= " class " . $this->getClassName();
18
		if( $this->getParentClass() != "" )
18
		if( $this->getParentClass() != "" )
19
		{
19
		{
20
			$strCode .= " extends " . $this->getParentClass()->getClassName(); 
20
			$strCode .= " extends " . $this->getParentClass()->getClassName();
21
		}
21
		}
22
		if( sizeof( $this->getInterfaceNames() ) > 0)
22
		if( sizeof( $this->getInterfaceNames() ) > 0)
23
		{
23
		{
...
...
25
			$arrInterfaces = $this->getInterfaces();
25
			$arrInterfaces = $this->getInterfaces();
26
			foreach(  $arrInterfaces as $objInterfaces )
26
			foreach(  $arrInterfaces as $objInterfaces )
27
			{
27
			{
28
				$arrInterfacesClassName[] = $objInterfaces->getClassName();	
28
				$arrInterfacesClassName[] = $objInterfaces->getClassName();
29
			}
29
			}
30
			$strCode .= " implements " . implode( ", " , $arrInterfacesClassName );
30
			$strCode .= " implements " . implode( ", " , $arrInterfacesClassName );
31
		}
31
		}
...
...
44
		}
44
		}
45
		return $strCode;
45
		return $strCode;
46
	}
46
	}
47
	
47
48
	public function createMethodsDefinitionCode()
48
	public function createMethodsDefinitionCode()
49
	{
49
	{
50
		$strCode = "";
50
		$strCode = "";
...
...
56
		}
56
		}
57
		return $strCode;
57
		return $strCode;
58
	}
58
	}
59
	
59
60
	public function getCode()
60
	public function getCode()
61
	{
61
	{
62
		$strCode = "";
62
		$strCode = "";
...
...
67
		$strCode .= "\n}\n";
67
		$strCode .= "\n}\n";
68
		return $strCode;
68
		return $strCode;
69
	}
69
	}
70
	
70
71
	protected function createExtendedReflectionClass( ReflectionClass $objOriginalReflectionClass )
71
	protected function createExtendedReflectionClass( ReflectionClass $objOriginalReflectionClass )
72
	{
72
	{
73
		return new CodeReflectionClass( $objOriginalReflectionClass->getName() );
73
		return new CodeReflectionClass( $objOriginalReflectionClass->getName() );
74
	}
74
	}
75
	
75
76
    protected function createExtendedReflectionProperty( ReflectionProperty $objOriginalReflectionProperty )
76
    protected function createExtendedReflectionProperty( ReflectionProperty $objOriginalReflectionProperty )
77
	{
77
	{
78
		return new CodeReflectionProperty( $this->getName() , $objOriginalReflectionProperty->getName() );
78
		return new CodeReflectionProperty( $this->getName() , $objOriginalReflectionProperty->getName() );
79
	}
79
	}
80
	
80
81
	protected function createExtendedReflectionMethod( ReflectionMethod $objOriginalReflectionMethod )
81
	protected function createExtendedReflectionMethod( ReflectionMethod $objOriginalReflectionMethod )
82
	{
82
	{
83
		return new CodeReflectionMethod( $this->getName() , $objOriginalReflectionMethod->getName() );
83
		return new CodeReflectionMethod( $this->getName() , $objOriginalReflectionMethod->getName() );