ProxyClass
class ProxyClass (View source)
Representation of a Proxy Class during rendering time
Properties
protected string | $namespace | Namespace, extracted from the fully qualified original class name |
|
protected string | $originalClassName | The original class name |
|
protected string | $fullOriginalClassName | Fully qualified class name of the original class |
|
protected ProxyConstructor | $constructor | ||
protected array | $methods | ||
protected array | $constants | ||
protected array | $interfaces | Note: Not using ProxyInterface::class here, since the interface names must have a leading backslash. |
|
protected array | $traits | ||
protected array | $properties | ||
protected ReflectionService | $reflectionService |
Methods
Creates a new ProxyClass instance.
Returns the ProxyConstructor for this ProxyClass. Creates it if needed.
Returns the named ProxyMethod for this ProxyClass. Creates it if needed.
Adds a constant to this proxy class
Adds a class property to this proxy class
Adds one or more interfaces to the "implements" section of the class definition.
Adds one or more traits to the class definition.
Renders and returns the PHP code for this ProxyClass.
Builds the class documentation block for the specified class keeping doc comments and vital annotations
Renders code for the added class constants
Renders code for the added class properties
Renders code for added traits
Details
__construct(string $fullOriginalClassName)
Creates a new ProxyClass instance.
void
injectReflectionService(ReflectionService $reflectionService)
Injects the Reflection Service
ProxyConstructor
getConstructor()
Returns the ProxyConstructor for this ProxyClass. Creates it if needed.
ProxyMethod
getMethod(string $methodName)
Returns the named ProxyMethod for this ProxyClass. Creates it if needed.
void
addConstant(string $name, string $valueCode)
Adds a constant to this proxy class
void
addProperty(string $name, string $initialValueCode, string $visibility = 'private', string $docComment = '')
Adds a class property to this proxy class
void
addInterfaces(array $interfaceNames)
Adds one or more interfaces to the "implements" section of the class definition.
Note that the passed interface names must already have a leading backslash, for example "\Neos\Flow\Foo\BarInterface".
void
addTraits(array $traitNames)
Adds one or more traits to the class definition.
Note that the passed trait names must have a leading backslash, for example "\Neos\Flow\ObjectManagement\Proxy\PropertyInjectionTrait".
string
render()
Renders and returns the PHP code for this ProxyClass.
protected string
buildClassDocumentation()
Builds the class documentation block for the specified class keeping doc comments and vital annotations
protected string
renderConstantsCode()
Renders code for the added class constants
protected string
renderPropertiesCode()
Renders code for the added class properties
protected string
renderTraitsCode()
Renders code for added traits