ProxyConstructorGenerator
final class ProxyConstructorGenerator extends ProxyMethodGenerator (View source)
Properties
protected | $addedPreParentCallCode | from ProxyMethodGenerator | |
protected | $addedPostParentCallCode | from ProxyMethodGenerator | |
protected | $attributesCode | from ProxyMethodGenerator | |
protected class-string|null | $fullOriginalClassName | from ProxyMethodGenerator |
Methods
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.
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
Build code which calls the parent method, if any.
Build the code for the attributes of a given \ReflectionMethod object.
No description
No description
No description
No description
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)
Build code which calls the parent method, if any.
Note that $fullClassName is the original, non-proxied class and $parentClassName is the name of a potential non-proxied parent class of the original class.
The context where the parent:: call is made is a proxy class. Therefore, the call will
- either call the method in the original class of the current proxy, if it exists, or
- call the original method in the parent class or
- call the proxied method in the parent class or
- call the original method in a subclass or
- call the proxied method in a subclass
See the ProxyCompilerTest functional tests for examples of these cases.
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.
__construct($name = null, array $parameters = [], $flags = self::FLAG_PUBLIC, $body = null, $docBlock = null)
No description
static never
copyMethodSignature(MethodReflection $reflectionMethod)
No description
string|null
getOriginalVisibility()
No description
protected string
buildAssignMethodArgumentsCode()
No description