PHP Класс Neos\Flow\ObjectManagement\DependencyInjection\ProxyClassBuilder

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$compiler Neos\Flow\ObjectManagement\Proxy\Compiler
$configurationManager Neos\Flow\Configuration\ConfigurationManager
$objectConfigurations array
$objectManager Neos\Flow\ObjectManagement\CompileTimeObjectManager
$reflectionService Neos\Flow\Reflection\ReflectionService
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Открытые методы

Метод Описание
build ( ) : void Analyzes the Object Configuration provided by the compiler and builds the necessary PHP code for the proxy classes to realize dependency injection.
buildPropertyInjectionCodeByConfigurationTypeAndPath ( Configuration $objectConfiguration, string $propertyName, string $configurationType, string $configurationPath = null ) : array Builds code which assigns the value stored in the specified configuration into the given class property.
buildPropertyInjectionCodeByString ( Configuration $objectConfiguration, Neos\Flow\ObjectManagement\Configuration\ConfigurationProperty $propertyConfiguration, string $propertyName, string $propertyObjectName ) : array Builds code which injects an object which was specified by its object name
injectCompiler ( Compiler $compiler ) : void
injectConfigurationManager ( ConfigurationManager $configurationManager ) : void
injectObjectManager ( CompileTimeObjectManager $objectManager ) : void
injectReflectionService ( ReflectionService $reflectionService ) : void
injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void

Защищенные методы

Метод Описание
buildConstructorInjectionCode ( Configuration $objectConfiguration ) : string Renders additional code for the __construct() method of the Proxy Class which realizes constructor injection.
buildCustomFactoryCall ( string $customFactoryObjectName, string $customFactoryMethodName, array $arguments ) : string
buildLazyPropertyInjectionCode ( string $propertyObjectName, string $propertyClassName, string $propertyName, string $preparedSetterArgument ) : array Builds code which injects a DependencyProxy instead of the actual dependency
buildLifecycleInitializationCode ( Configuration $objectConfiguration, integer $cause ) : string Builds code which calls the lifecycle initialization method, if any.
buildLifecycleShutdownCode ( Configuration $objectConfiguration ) : string Builds code which registers the lifecycle shutdown method, if any.
buildMethodParametersCode ( array $argumentConfigurations ) : string FIXME: Not yet completely refactored to new proxy mechanism
buildPropertyInjectionCode ( Configuration $objectConfiguration ) : string Builds the code necessary to inject setter based dependencies.
buildPropertyInjectionCodeByConfiguration ( Configuration $objectConfiguration, string $propertyName, Configuration $propertyConfiguration ) : array Builds code which injects an object which was specified by its object configuration
buildSerializeRelatedEntitiesCode ( Configuration $objectConfiguration ) : string Renders code to create identifier/type information from related entities in an object.
buildSetInstanceCode ( Configuration $objectConfiguration ) : string Renders additional code which registers the instance of the proxy class at the Object Manager before constructor injection is executed. Used in constructors and wakeup methods.
buildSetterInjectionCode ( string $className, string $propertyName, string $preparedSetterArgument ) : array Builds a code snippet which tries to inject the specified property first through calling the related inject*() method and then the set*() method. If neither exists and the property doesn't exist either, an empty array is returned.
compileStaticMethods ( string $className, ProxyClass $proxyClass ) : void Compile the result of methods marked with CompileStatic into the proxy class

Описание методов

build() публичный Метод

Analyzes the Object Configuration provided by the compiler and builds the necessary PHP code for the proxy classes to realize dependency injection.
public build ( ) : void
Результат void

buildConstructorInjectionCode() защищенный Метод

Renders additional code for the __construct() method of the Proxy Class which realizes constructor injection.
protected buildConstructorInjectionCode ( Configuration $objectConfiguration ) : string
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration
Результат string The built code

buildCustomFactoryCall() защищенный Метод

protected buildCustomFactoryCall ( string $customFactoryObjectName, string $customFactoryMethodName, array $arguments ) : string
$customFactoryObjectName string
$customFactoryMethodName string
$arguments array
Результат string

buildLazyPropertyInjectionCode() защищенный Метод

Builds code which injects a DependencyProxy instead of the actual dependency
protected buildLazyPropertyInjectionCode ( string $propertyObjectName, string $propertyClassName, string $propertyName, string $preparedSetterArgument ) : array
$propertyObjectName string Object name of the dependency to inject
$propertyClassName string Class name of the dependency to inject
$propertyName string Name of the property in the class to inject into
$preparedSetterArgument string PHP code to use for retrieving the value to inject
Результат array PHP code

buildLifecycleInitializationCode() защищенный Метод

Builds code which calls the lifecycle initialization method, if any.
protected buildLifecycleInitializationCode ( Configuration $objectConfiguration, integer $cause ) : string
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration
$cause integer a \Neos\Flow\ObjectManagement\ObjectManagerInterface::INITIALIZATIONCAUSE_* constant which is the cause of the initialization command being called.
Результат string

buildLifecycleShutdownCode() защищенный Метод

Builds code which registers the lifecycle shutdown method, if any.
protected buildLifecycleShutdownCode ( Configuration $objectConfiguration ) : string
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration
Результат string

buildMethodParametersCode() защищенный Метод

FIXME: Not yet completely refactored to new proxy mechanism
protected buildMethodParametersCode ( array $argumentConfigurations ) : string
$argumentConfigurations array
Результат string

buildPropertyInjectionCode() защищенный Метод

Builds the code necessary to inject setter based dependencies.
protected buildPropertyInjectionCode ( Configuration $objectConfiguration ) : string
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration (needed to produce helpful exception message)
Результат string The built code

buildPropertyInjectionCodeByConfiguration() защищенный Метод

Builds code which injects an object which was specified by its object configuration
protected buildPropertyInjectionCodeByConfiguration ( Configuration $objectConfiguration, string $propertyName, Configuration $propertyConfiguration ) : array
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration Configuration of the object to inject into
$propertyName string Name of the property to inject
$propertyConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration Configuration of the object to inject
Результат array PHP code

buildPropertyInjectionCodeByConfigurationTypeAndPath() публичный Метод

Builds code which assigns the value stored in the specified configuration into the given class property.
public buildPropertyInjectionCodeByConfigurationTypeAndPath ( Configuration $objectConfiguration, string $propertyName, string $configurationType, string $configurationPath = null ) : array
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration Configuration of the object to inject into
$propertyName string Name of the property to inject
$configurationType string the configuration type of the injected property (one of the ConfigurationManager::CONFIGURATION_TYPE_* constants)
$configurationPath string Path with "." as separator specifying the setting value to inject or NULL if the complete configuration array should be injected
Результат array PHP code

buildPropertyInjectionCodeByString() публичный Метод

Builds code which injects an object which was specified by its object name
public buildPropertyInjectionCodeByString ( Configuration $objectConfiguration, Neos\Flow\ObjectManagement\Configuration\ConfigurationProperty $propertyConfiguration, string $propertyName, string $propertyObjectName ) : array
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration Configuration of the object to inject into
$propertyConfiguration Neos\Flow\ObjectManagement\Configuration\ConfigurationProperty
$propertyName string Name of the property to inject
$propertyObjectName string Object name of the object to inject
Результат array PHP code

buildSerializeRelatedEntitiesCode() защищенный Метод

Used in sleep methods.
protected buildSerializeRelatedEntitiesCode ( Configuration $objectConfiguration ) : string
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration
Результат string

buildSetInstanceCode() защищенный Метод

This also makes sure that object creation does not end in an endless loop due to bi-directional dependencies.
protected buildSetInstanceCode ( Configuration $objectConfiguration ) : string
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration
Результат string

buildSetterInjectionCode() защищенный Метод

If neither inject*() nor set*() exists, but the property does exist, NULL is returned
protected buildSetterInjectionCode ( string $className, string $propertyName, string $preparedSetterArgument ) : array
$className string Name of the class to inject into
$propertyName string Name of the property to inject
$preparedSetterArgument string PHP code to use for retrieving the value to inject
Результат array PHP code

compileStaticMethods() защищенный Метод

Compile the result of methods marked with CompileStatic into the proxy class
protected compileStaticMethods ( string $className, ProxyClass $proxyClass ) : void
$className string
$proxyClass Neos\Flow\ObjectManagement\Proxy\ProxyClass
Результат void

injectCompiler() публичный Метод

public injectCompiler ( Compiler $compiler ) : void
$compiler Neos\Flow\ObjectManagement\Proxy\Compiler
Результат void

injectConfigurationManager() публичный Метод

public injectConfigurationManager ( ConfigurationManager $configurationManager ) : void
$configurationManager Neos\Flow\Configuration\ConfigurationManager
Результат void

injectObjectManager() публичный Метод

public injectObjectManager ( CompileTimeObjectManager $objectManager ) : void
$objectManager Neos\Flow\ObjectManagement\CompileTimeObjectManager
Результат void

injectReflectionService() публичный Метод

public injectReflectionService ( ReflectionService $reflectionService ) : void
$reflectionService Neos\Flow\Reflection\ReflectionService
Результат void

injectSystemLogger() публичный Метод

public injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
$systemLogger Neos\Flow\Log\SystemLoggerInterface
Результат void

Описание свойств

$compiler защищенное свойство

protected Compiler,Neos\Flow\ObjectManagement\Proxy $compiler
Результат Neos\Flow\ObjectManagement\Proxy\Compiler

$configurationManager защищенное свойство

protected ConfigurationManager,Neos\Flow\Configuration $configurationManager
Результат Neos\Flow\Configuration\ConfigurationManager

$objectConfigurations защищенное свойство

protected array $objectConfigurations
Результат array

$objectManager защищенное свойство

protected CompileTimeObjectManager,Neos\Flow\ObjectManagement $objectManager
Результат Neos\Flow\ObjectManagement\CompileTimeObjectManager

$reflectionService защищенное свойство

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Результат Neos\Flow\Reflection\ReflectionService

$systemLogger защищенное свойство

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Результат Neos\Flow\Log\SystemLoggerInterface