PHP Class Neos\Flow\ObjectManagement\Proxy\ProxyMethod

Mostrar archivo Open project: neos/flow-development-collection

Public Properties

Property Type Description
$methodBody string

Protected Properties

Property Type Description
$addedPostParentCallCode string
$addedPreParentCallCode string
$fullOriginalClassName string Fully qualified class name of the original class
$methodName string Name of the original method
$methodParametersCode string
$reflectionService Neos\Flow\Reflection\ReflectionService
$visibility string Visibility of the method

Public Methods

Method Description
__construct ( string $fullOriginalClassName, string $methodName ) Constructor
addPostParentCallCode ( string $code ) : void Adds PHP code to the body of this method which will be executed after a possible parent call.
addPreParentCallCode ( string $code ) : void Adds PHP code to the body of this method which will be executed before a possible parent call.
buildMethodParametersCode ( string $fullClassName, string $methodName, boolean $addTypeAndDefaultValue = true ) : string Builds the PHP code for the parameters of the specified method to be used in a method interceptor in the proxy class
injectReflectionService ( ReflectionService $reflectionService ) : void Injects the Reflection Service
overrideMethodVisibility ( string $visibility ) : void Overrides the method's visibility
render ( ) : string Renders the PHP code for this Proxy Method
setMethodBody ( string $methodBody ) : void Override the method body
setMethodParametersCode ( string $code ) : void Sets the (exact) code which use used in as the parameters signature for this method.
willBeRendered ( ) : boolean Tells if enough code was provided (yet) so that this method would actually be rendered if render() is called.

Protected Methods

Method Description
buildArraySetupCode ( array $array ) : string Builds a string containing PHP code to build the array given as input.
buildCallParentMethodCode ( string $fullClassName, string $methodName ) : string Builds PHP code which calls the original (ie. parent) method after the added code has been executed.
buildMethodDocumentation ( string $className, string $methodName ) : string Builds the method documentation block for the specified method keeping the vital annotations
getMethodVisibilityString ( ) : string 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.

Method Details

__construct() public method

Constructor
public __construct ( string $fullOriginalClassName, string $methodName )
$fullOriginalClassName string The fully qualified class name of the original class
$methodName string Name of the proxy (and original) method

addPostParentCallCode() public method

Adds PHP code to the body of this method which will be executed after a possible parent call.
public addPostParentCallCode ( string $code ) : void
$code string
return void

addPreParentCallCode() public method

Adds PHP code to the body of this method which will be executed before a possible parent call.
public addPreParentCallCode ( string $code ) : void
$code string
return void

buildArraySetupCode() protected method

Builds a string containing PHP code to build the array given as input.
protected buildArraySetupCode ( array $array ) : string
$array array
return string e.g. 'array()' or 'array(1 => 'bar')

buildCallParentMethodCode() protected method

Builds PHP code which calls the original (ie. parent) method after the added code has been executed.
protected buildCallParentMethodCode ( string $fullClassName, string $methodName ) : string
$fullClassName string Fully qualified name of the original class
$methodName string Name of the original method
return string PHP code

buildMethodDocumentation() protected method

Builds the method documentation block for the specified method keeping the vital annotations
protected buildMethodDocumentation ( string $className, string $methodName ) : string
$className string Name of the class the method is declared in
$methodName string Name of the method to create the parameters code for
return string $methodDocumentation DocComment for the given method

buildMethodParametersCode() public method

Builds the PHP code for the parameters of the specified method to be used in a method interceptor in the proxy class
public buildMethodParametersCode ( string $fullClassName, string $methodName, boolean $addTypeAndDefaultValue = true ) : string
$fullClassName string Name of the class the method is declared in
$methodName string Name of the method to create the parameters code for
$addTypeAndDefaultValue boolean If the type and default value for each parameters should be rendered
return string A comma speparated list of parameters

getMethodVisibilityString() protected method

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.
protected getMethodVisibilityString ( ) : string
return string One of 'public', 'protected' or 'private'

injectReflectionService() public method

Injects the Reflection Service
public injectReflectionService ( ReflectionService $reflectionService ) : void
$reflectionService Neos\Flow\Reflection\ReflectionService
return void

overrideMethodVisibility() public method

Overrides the method's visibility
public overrideMethodVisibility ( string $visibility ) : void
$visibility string One of 'public', 'protected', 'private'
return void

render() public method

Renders the PHP code for this Proxy Method
public render ( ) : string
return string PHP code

setMethodBody() public method

Override the method body
public setMethodBody ( string $methodBody ) : void
$methodBody string
return void

setMethodParametersCode() public method

Sets the (exact) code which use used in as the parameters signature for this method.
public setMethodParametersCode ( string $code ) : void
$code string Parameters code, for example: '$foo, array $bar, \Foo\Bar\Baz $baz'
return void

willBeRendered() public method

Tells if enough code was provided (yet) so that this method would actually be rendered if render() is called.
public willBeRendered ( ) : boolean
return boolean TRUE if there is any code to render, otherwise FALSE

Property Details

$addedPostParentCallCode protected_oe property

protected string $addedPostParentCallCode
return string

$addedPreParentCallCode protected_oe property

protected string $addedPreParentCallCode
return string

$fullOriginalClassName protected_oe property

Fully qualified class name of the original class
protected string $fullOriginalClassName
return string

$methodBody public_oe property

public string $methodBody
return string

$methodName protected_oe property

Name of the original method
protected string $methodName
return string

$methodParametersCode protected_oe property

protected string $methodParametersCode
return string

$reflectionService protected_oe property

protected ReflectionService,Neos\Flow\Reflection $reflectionService
return Neos\Flow\Reflection\ReflectionService

$visibility protected_oe property

Visibility of the method
protected string $visibility
return string