ProxyConstructor
class ProxyConstructor extends ProxyMethod (View source)
Representation of a constructor method within a proxy class
Constants
BEFORE_PARENT_CALL |
|
AFTER_PARENT_CALL |
|
Properties
protected string | $fullOriginalClassName | Fully qualified class name of the original class |
from ProxyMethod |
protected string | $methodName | Name of the original method |
|
protected string | $visibility | Visibility of the method |
from ProxyMethod |
protected string | $addedPreParentCallCode | from ProxyMethod | |
protected string | $addedPostParentCallCode | from ProxyMethod | |
protected string | $methodParametersCode | from ProxyMethod | |
string | $methodBody | from ProxyMethod | |
protected ReflectionService | $reflectionService | from ProxyMethod |
Methods
No description
Overrides the method's visibility
Returns TRUE if this proxy belongs to a private method, otherwise FALSE
Adds PHP code to the body of this method which will be executed before a possible parent call.
Adds PHP code to the body of this method which will be executed after a possible parent call.
Sets the (exact) code which use used in as the parameters signature for this method.
Renders the code for a proxy constructor
Tells if enough code was provided (yet) so that this method would actually be rendered if render() is called.
Builds the method documentation block for the specified method keeping the vital annotations
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 (ie. parent) method after the added code has been executed.
Builds a string containing PHP code to build the array given as input.
Returns the method's visibility string found by the reflection service Note: If the reflection service has no information about this method, 'public' is returned.
Details
__construct(string $fullOriginalClassName)
No description
void
injectReflectionService(ReflectionService $reflectionService)
Injects the Reflection Service
void
overrideMethodVisibility(string $visibility)
Overrides the method's visibility
bool
isPrivate()
Returns TRUE if this proxy belongs to a private method, otherwise FALSE
void
addPreParentCallCode(string $code)
Adds PHP code to the body of this method which will be executed before a possible parent call.
void
addPostParentCallCode(string $code)
Adds PHP code to the body of this method which will be executed after a possible parent call.
void
setMethodParametersCode(string $code)
Sets the (exact) code which use used in as the parameters signature for this method.
string
render()
Renders the code for a proxy constructor
bool
willBeRendered()
Tells if enough code was provided (yet) so that this method would actually be rendered if render() is called.
protected string
buildMethodDocumentation(string $className, string $methodName)
Builds the method documentation block for the specified method keeping the vital annotations
string
buildMethodParametersCode(string $fullClassName, string $methodName, bool $addTypeAndDefaultValue = true)
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 (ie. parent) method after the added code has been executed.
protected string
buildArraySetupCode(array $array)
Builds a string containing PHP code to build the array given as input.
protected string
getMethodVisibilityString()
Returns the method's visibility string found by the reflection service Note: If the reflection service has no information about this method, 'public' is returned.
void
setMethodBody(string $methodBody)
Override the method body