ProxyMethodGenerator
class ProxyMethodGenerator extends MethodGenerator (View source)
Class ProxyMethodGenerator
This class is responsible for generating proxy methods that can be used as method interceptors. It extends the MethodGenerator class.
Properties
protected | $addedPreParentCallCode | ||
protected | $addedPostParentCallCode | ||
protected | $attributesCode | ||
protected class-string|null | $fullOriginalClassName |
Methods
No description
No description
No description
No description
Adds PHP code to the body of this proxy method which will be executed before a possible parent call.
Adds PHP code to the body of this proxy method which will be executed after a possible parent call.
Generates the code for the method.
No description
Tells if enough code was provided (yet) so that this method would actually be rendered if render() is called.
Builds the PHP code for the parameters of the specified method to be used in a method interceptor in the proxy class
Builds PHP code which calls the original (i.e. parent) method after the added code has been executed.
Build the code for the attributes of a given \ReflectionMethod object.
Details
static ProxyMethodGenerator
fromReflection(MethodReflection $reflectionMethod)
No description
static ProxyMethodGenerator
copyMethodSignatureAndDocblock(MethodReflection $reflectionMethod)
No description
string|null
getFullOriginalClassName()
No description
void
setFullOriginalClassName(string $fullOriginalClassName)
No description
void
addPreParentCallCode(string $code)
Adds PHP code to the body of this proxy method which will be executed before a possible parent call.
void
addPostParentCallCode(string $code)
Adds PHP code to the body of this proxy method which will be executed after a possible parent call.
string
generate()
Generates the code for the method.
This method overrides the parent generate() method in order to insert attributes code. As soon as https://github.com/laminas/laminas-code/pull/145 is merged and released, this can be implemented properly.
string
renderBodyCode()
No description
bool
willBeRendered()
Tells if enough code was provided (yet) so that this method would actually be rendered if render() is called.
string
buildMethodParametersCode(string|null $fullClassName, string|null $methodName, bool $addTypeAndDefaultValue)
Builds the PHP code for the parameters of the specified method to be used in a method interceptor in the proxy class
protected string
buildCallParentMethodCode(string $fullClassName, string $methodName)
Builds PHP code which calls the original (i.e. parent) method after the added code has been executed.
protected string
buildAttributesCode(ReflectionMethod $reflectionMethod)
Build the code for the attributes of a given \ReflectionMethod object.
Note: This is just a preliminary solution until https://github.com/laminas/laminas-code/pull/145 is implemented and released.