Property | Type | Description | |
---|---|---|---|
$class | null | ReflectionClas\ReflectionClass | Parent class reflection | |
$interfaces | array | List of additional interfaces to implement | |
$invocationClassMap | null | array | .else check | |
$methodsCode | Source code for methods | ||
$name | string | Name for the current class | |
$parentClassName | string | Parent class name, can be changed manually | |
$propertiesCode | Source code for properties | ||
$traits | array | List of additional traits for using |
Method | Description | |
---|---|---|
__construct ( ReflectionClass $parent, array $classAdvices ) | Generates an child code by parent class reflection and joinpoints for it | |
__toString ( ) | {@inheritDoc} | |
addInterface ( string | ReflectionClas\ReflectionClass $interface ) | Add an interface for child | |
addTrait ( string | ReflectionClas\ReflectionClass $trait ) | Add a trait for child | |
injectJoinPoints ( string $className, array $advices = [] ) : void | Inject advices into given class | |
override ( string $methodName, string $body ) : static | Override parent method with new body | |
setMethod ( integer $methodFlags, string $methodName, boolean $byReference, string $body, string $parameters ) : static | Creates a method | |
setParentName ( string $newParentName ) : static | Updates parent name for child | |
setProperty ( integer $propFlags, string $propName, null | string $defaultText = null ) : static | Creates a property |
Method | Description | |
---|---|---|
addFieldInterceptorsCode ( ReflectionMethod $constructor = null ) | Add code for intercepting properties | |
addJoinpointsProperty ( ) : void | Adds a definition for joinpoints private property in the class | |
getJoinpointInvocationBody ( ReflectionMethod $method ) : string | Creates definition for method body | |
interceptProperty ( ReflectionProperty $property ) | Makes property intercepted | |
overrideMethod ( ReflectionMethod $method ) | Override parent method with joinpoint invocation | |
wrapWithJoinPoints ( array | Go\Aop\Advice[] $classAdvices, string $className ) : array | Go\Aop\Intercept\Joinpoint[] | Wrap advices with joinpoint object |
Method | Description | |
---|---|---|
getConstructorBody ( ReflectionMethod $constructor = null, boolean $isCallParent = false ) : string | Returns constructor code |
public __construct ( ReflectionClass $parent, array $classAdvices ) | ||
$parent | ReflectionClass | Parent class reflection |
$classAdvices | array | List of advices for class |
protected addFieldInterceptorsCode ( ReflectionMethod $constructor = null ) | ||
$constructor | ReflectionMethod | Constructor reflection or null |
public addInterface ( string | ReflectionClas\ReflectionClass $interface ) | ||
$interface | string | ReflectionClas\ReflectionClass |
protected addJoinpointsProperty ( ) : void | ||
return | void |
protected getJoinpointInvocationBody ( ReflectionMethod $method ) : string | ||
$method | ReflectionMethod | Method reflection |
return | string | new method body |
protected interceptProperty ( ReflectionProperty $property ) | ||
$property | ReflectionProperty | Reflection of property to intercept |
protected overrideMethod ( ReflectionMethod $method ) | ||
$method | ReflectionMethod | Method reflection |
public setMethod ( integer $methodFlags, string $methodName, boolean $byReference, string $body, string $parameters ) : static | ||
$methodFlags | integer | See ReflectionMethod modifiers |
$methodName | string | Name of the method |
$byReference | boolean | Is method should return value by reference |
$body | string | Body of method |
$parameters | string | Definition of parameters |
return | static |
public setParentName ( string $newParentName ) : static | ||
$newParentName | string | New class name |
return | static |
protected static wrapWithJoinPoints ( array | Go\Aop\Advice[] $classAdvices, string $className ) : array | Go\Aop\Intercept\Joinpoint[] | ||
$classAdvices | array | Go\Aop\Advice[] | Advices for specific class |
$className | string | Name of the original class to use |
return | array | Go\Aop\Intercept\Joinpoint[] | returns list of joinpoint ready to use |
protected null|ReflectionClass,ReflectionClas $class | ||
return | null | ReflectionClas\ReflectionClass |
protected array $interfaces | ||
return | array |
protected string $parentClassName | ||
return | string |
protected array $traits | ||
return | array |