PHP Class Neos\Flow\ObjectManagement\Proxy\ProxyClass

Mostrar archivo Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$constants array
$constructor ProxyConstructor
$fullOriginalClassName string Fully qualified class name of the original class
$interfaces array Note: Not using ProxyInterface::class here, since the interface names must have a leading backslash.
$methods array
$namespace string Namespace, extracted from the fully qualified original class name
$originalClassName string The original class name
$properties array
$reflectionService Neos\Flow\Reflection\ReflectionService
$traits array

Public Methods

Method Description
__construct ( string $fullOriginalClassName ) Creates a new ProxyClass instance.
addConstant ( string $name, string $valueCode ) : void Adds a constant to this proxy class
addInterfaces ( array $interfaceNames ) : void Adds one or more interfaces to the "implements" section of the class definition.
addProperty ( string $name, string $initialValueCode, string $visibility = 'private', string $docComment = '' ) : void Adds a class property to this proxy class
addTraits ( array $traitNames ) : void Adds one or more traits to the class definition.
getConstructor ( ) : ProxyConstructor Returns the ProxyConstructor for this ProxyClass. Creates it if needed.
getMethod ( string $methodName ) : ProxyMethod Returns the named ProxyMethod for this ProxyClass. Creates it if needed.
injectReflectionService ( ReflectionService $reflectionService ) : void Injects the Reflection Service
render ( ) : string Renders and returns the PHP code for this ProxyClass.

Protected Methods

Method Description
buildClassDocumentation ( ) : string Builds the class documentation block for the specified class keeping doc comments and vital annotations
renderConstantsCode ( ) : string Renders code for the added class constants
renderPropertiesCode ( ) : string Renders code for the added class properties
renderTraitsCode ( ) : string Renders code for added traits

Method Details

__construct() public method

Creates a new ProxyClass instance.
public __construct ( string $fullOriginalClassName )
$fullOriginalClassName string The fully qualified class name of the original class

addConstant() public method

Adds a constant to this proxy class
public addConstant ( string $name, string $valueCode ) : void
$name string Name of the constant. Should be ALL_UPPERCASE_WITH_UNDERSCORES
$valueCode string PHP code which assigns the value. Example: 'foo' (including quotes!)
return void

addInterfaces() public method

Note that the passed interface names must already have a leading backslash, for example "\Neos\Flow\Foo\BarInterface".
public addInterfaces ( array $interfaceNames ) : void
$interfaceNames array Fully qualified names of the interfaces to introduce
return void

addProperty() public method

Adds a class property to this proxy class
public addProperty ( string $name, string $initialValueCode, string $visibility = 'private', string $docComment = '' ) : void
$name string Name of the property
$initialValueCode string PHP code of the initial value assignment
$visibility string
$docComment string
return void

addTraits() public method

Note that the passed trait names must have a leading backslash, for example "\Neos\Flow\ObjectManagement\Proxy\PropertyInjectionTrait".
public addTraits ( array $traitNames ) : void
$traitNames array
return void

buildClassDocumentation() protected method

Builds the class documentation block for the specified class keeping doc comments and vital annotations
protected buildClassDocumentation ( ) : string
return string $methodDocumentation DocComment for the given method

getConstructor() public method

Returns the ProxyConstructor for this ProxyClass. Creates it if needed.
public getConstructor ( ) : ProxyConstructor
return ProxyConstructor

getMethod() public method

Returns the named ProxyMethod for this ProxyClass. Creates it if needed.
public getMethod ( string $methodName ) : ProxyMethod
$methodName string The name of the methods to return
return ProxyMethod

injectReflectionService() public method

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

render() public method

Renders and returns the PHP code for this ProxyClass.
public render ( ) : string
return string

renderConstantsCode() protected method

Renders code for the added class constants
protected renderConstantsCode ( ) : string
return string

renderPropertiesCode() protected method

Renders code for the added class properties
protected renderPropertiesCode ( ) : string
return string

renderTraitsCode() protected method

Renders code for added traits
protected renderTraitsCode ( ) : string
return string

Property Details

$constants protected_oe property

protected array $constants
return array

$constructor protected_oe property

protected ProxyConstructor,Neos\Flow\ObjectManagement\Proxy $constructor
return ProxyConstructor

$fullOriginalClassName protected_oe property

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

$interfaces protected_oe property

Note: Not using ProxyInterface::class here, since the interface names must have a leading backslash.
protected array $interfaces
return array

$methods protected_oe property

protected array $methods
return array

$namespace protected_oe property

Namespace, extracted from the fully qualified original class name
protected string $namespace
return string

$originalClassName protected_oe property

The original class name
protected string $originalClassName
return string

$properties protected_oe property

protected array $properties
return array

$reflectionService protected_oe property

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

$traits protected_oe property

protected array $traits
return array