
Public Member Functions | |
| __construct ($strClassName, $strEvalContent="") | |
| getClassName () | |
| setClassName ($strName) | |
| createMethodsDefinitionCode () | |
Protected Member Functions | |
| createExtendedReflectionClass (ReflectionClass $objOriginalReflectionClass) | |
| createExtendedReflectionProperty (ReflectionProperty $objOriginalReflectionProperty) | |
| createExtendedReflectionMethod (ReflectionMethod $objOriginalReflectionMethod) | |
Protected Attributes | |
| $strName = null | |
Definition at line 15 of file CodeInstrumentationClass.class.php.
| __construct | ( | $ | strClassName, | |
| $ | strEvalContent = "" | |||
| ) |
Construct the Code Instrumentation of the class.
It must receive the eval content if the class it was created into a eval command.
| string | $strClassName | |
| string | $strEvalContent |
Reimplemented from CodeReflectionClass.
Definition at line 32 of file CodeInstrumentationClass.class.php.
00033 { 00034 parent::__construct( $strClassName ); 00035 if( $strEvalContent != "" ) 00036 { 00037 new CodeReflectionFile( $this->getFileName() , $strEvalContent , false ); 00038 } 00039 }
| createExtendedReflectionClass | ( | ReflectionClass $ | objOriginalReflectionClass | ) | [protected] |
Make the recursive calls and indirectly call return the extended reflection object and not a native reflection class.
| ReflectionClass | $objOriginalReflectionClass |
Reimplemented from CodeReflectionClass.
Definition at line 151 of file CodeInstrumentationClass.class.php.
00152 { 00153 return new CodeInstrumentationClass( $objOriginalReflectionClass->getName() ); 00154 }
| createExtendedReflectionMethod | ( | ReflectionMethod $ | objOriginalReflectionMethod | ) | [protected] |
Make the recursive calls and indirectly call return the extended reflection object and not a native reflection class.
| ReflectionClass | $objOriginalReflectionClass |
Reimplemented from CodeReflectionClass.
Definition at line 177 of file CodeInstrumentationClass.class.php.
00178 { 00179 return new CodeInstrumentationMethod( $this->getName() , $objOriginalReflectionMethod->getName() ); 00180 }
| createExtendedReflectionProperty | ( | ReflectionProperty $ | objOriginalReflectionProperty | ) | [protected] |
Make the recursive calls and indirectly call return the extended reflection object and not a native reflection class.
| ReflectionClass | $objOriginalReflectionClass |
Reimplemented from CodeReflectionClass.
Definition at line 164 of file CodeInstrumentationClass.class.php.
00165 { 00166 return new CodeInstrumentationProperty( $this->getName() , $objOriginalReflectionProperty->getName() ); 00167 }
| createMethodsDefinitionCode | ( | ) |
Create the methods definition code with code instrumentation.
Create the methods of the class changed to can send the messages to the code instrumentation receive before and after each call.
Reimplemented from CodeReflectionClass.
Definition at line 96 of file CodeInstrumentationClass.class.php.
References ExtendedReflectionClass::getMethods().
00097 { 00098 if( $this->isInterface() ) 00099 { 00100 return parent::createMethodsDefinitionCode(); 00101 } 00102 00103 $strCode = ''; 00104 $boolHasConstructor = false; 00105 $boolHasDestructor = false; 00106 00107 foreach( $this->getMethods() as $objMethodReflection ) 00108 { 00109 if( $objMethodReflection->getName() == '__construct' ) 00110 { 00111 $boolHasConstructor = true; 00112 } 00113 if( $objMethodReflection->getName() == '__destruct' ) 00114 { 00115 $boolHasDestructor = true; 00116 } 00117 } 00118 00119 $strCode = parent::createMethodsDefinitionCode(); 00120 if( $boolHasConstructor == false ) 00121 { 00122 $strCode .= ' public function __construct() ' . "\n"; 00123 $strCode .= ' { ' . "\n"; 00124 $strCode .= ' $arrArguments = func_get_args(); ' . "\n"; 00125 $strCode .= ' $mixReturn = null; ' . "\n"; 00126 $strCode .= ' CodeInstrumentationReceiver::getInstance()->onEnterMethod( spl_object_hash($this) , __CLASS__ , __METHOD__ , $arrArguments );' . "\n"; 00127 $strCode .= ' CodeInstrumentationReceiver::getInstance()->onLeaveMethod( spl_object_hash($this) , __CLASS__ , __METHOD__ , $mixReturn );' . "\n"; 00128 $strCode .= ' } ' . "\n"; 00129 } 00130 if( $boolHasDestructor == false ) 00131 { 00132 $strCode .= ' public function __destruct() ' . "\n"; 00133 $strCode .= ' { ' . "\n"; 00134 $strCode .= ' $arrArguments = func_get_args(); ' . "\n"; 00135 $strCode .= ' $mixReturn = null; ' . "\n"; 00136 $strCode .= ' CodeInstrumentationReceiver::getInstance()->onEnterMethod( spl_object_hash($this) , __CLASS__ , __METHOD__ , $arrArguments );' . "\n"; 00137 $strCode .= ' CodeInstrumentationReceiver::getInstance()->onLeaveMethod( spl_object_hash($this) , __CLASS__ , __METHOD__ , $mixReturn );' . "\n"; 00138 $strCode .= ' } ' . "\n"; 00139 } 00140 return $strCode; 00141 }
| getClassName | ( | ) |
Returns the editable class name
$this->setClassName( "new_class" )->getClassName() == "new_class"
true
CodeInstrumentationClass::setClassName( string )
Reimplemented from CodeReflectionClass.
Definition at line 51 of file CodeInstrumentationClass.class.php.
00052 { 00053 if( $this->strName == null ) 00054 { 00055 return parent::getClassName(); 00056 } 00057 else 00058 { 00059 return $this->strName; 00060 } 00061 }
| setClassName | ( | $ | strName | ) |
Set the editable class name
$this->setClassName( "new_class" )->getClassName() == "new_class"
true
| string | $strName |
Definition at line 77 of file CodeInstrumentationClass.class.php.
References $strName.
00078 { 00079 $this->strName = $strName; 00080 return $this; 00081 }
$strName = null [protected] |
The editable class name
string
Definition at line 21 of file CodeInstrumentationClass.class.php.
Referenced by setClassName().
1.5.9