PHP Class Neos\Flow\ObjectManagement\Configuration\ConfigurationBuilder

Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$reflectionService Neos\Flow\Reflection\ReflectionService
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Public Methods

Method Description
buildObjectConfigurations ( array $availableClassAndInterfaceNamesByPackage, array $rawObjectConfigurationsByPackages ) : array Traverses through the given class and interface names and builds a base object configuration for all of them. Then parses the provided extra configuration and merges the result into the overall configuration. Finally autowires dependencies of arguments and properties which can be resolved automatically.
injectReflectionService ( ReflectionService $reflectionService ) : void
injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void

Protected Methods

Method Description
autowireArguments ( array &$objectConfigurations ) : void If mandatory constructor arguments have not been defined yet, this function tries to autowire them if possible.
autowireProperties ( array &$objectConfigurations ) : void This function tries to find yet unmatched dependencies which need to be injected via "inject*" setter methods.
enhanceRawConfigurationWithAnnotationOptions ( string $className, array $rawObjectConfiguration ) : array Builds a raw configuration array by parsing possible scope and autowiring annotations from the given class or interface.
parseArgumentOfTypeObject ( string $argumentName, mixed $objectNameOrConfiguration, string $configurationSourceHint ) : ConfigurationArgument Parses the configuration for arguments of type OBJECT
parseAutowiring ( mixed $value ) : integer Parses the value of the option "autowiring"
parseConfigurationArray ( string $objectName, array $rawConfigurationOptions, string $configurationSourceHint = '', Configuration $existingObjectConfiguration = null ) : Configuration Builds an object configuration object from a generic configuration container.
parsePropertyOfTypeObject ( string $propertyName, mixed $objectNameOrConfiguration, Configuration $parentObjectConfiguration ) : ConfigurationProperty Parses the configuration for properties of type OBJECT
parseScope ( string $value ) : integer Parses the value of the option "scope"

Method Details

autowireArguments() protected method

If mandatory constructor arguments have not been defined yet, this function tries to autowire them if possible.
protected autowireArguments ( array &$objectConfigurations ) : void
$objectConfigurations array
return void

autowireProperties() protected method

This function tries to find yet unmatched dependencies which need to be injected via "inject*" setter methods.
protected autowireProperties ( array &$objectConfigurations ) : void
$objectConfigurations array
return void

buildObjectConfigurations() public method

Traverses through the given class and interface names and builds a base object configuration for all of them. Then parses the provided extra configuration and merges the result into the overall configuration. Finally autowires dependencies of arguments and properties which can be resolved automatically.
public buildObjectConfigurations ( array $availableClassAndInterfaceNamesByPackage, array $rawObjectConfigurationsByPackages ) : array
$availableClassAndInterfaceNamesByPackage array An array of available class names, grouped by package key
$rawObjectConfigurationsByPackages array An array of package keys and their raw (ie. unparsed) object configurations
return array

enhanceRawConfigurationWithAnnotationOptions() protected method

Builds a raw configuration array by parsing possible scope and autowiring annotations from the given class or interface.
protected enhanceRawConfigurationWithAnnotationOptions ( string $className, array $rawObjectConfiguration ) : array
$className string
$rawObjectConfiguration array
return array

injectReflectionService() public method

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

injectSystemLogger() public method

public injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
$systemLogger Neos\Flow\Log\SystemLoggerInterface
return void

parseArgumentOfTypeObject() protected method

Parses the configuration for arguments of type OBJECT
protected parseArgumentOfTypeObject ( string $argumentName, mixed $objectNameOrConfiguration, string $configurationSourceHint ) : ConfigurationArgument
$argumentName string Name of the argument
$objectNameOrConfiguration mixed Value of the "object" section of the argument configuration - either a string or an array
$configurationSourceHint string A human readable hint on the original source of the configuration (for troubleshooting)
return ConfigurationArgument A configuration argument of type object

parseAutowiring() protected static method

Parses the value of the option "autowiring"
protected static parseAutowiring ( mixed $value ) : integer
$value mixed Value of the option
return integer The autowiring option translated into one of Configuration::AUTOWIRING_MODE_*

parseConfigurationArray() protected method

Builds an object configuration object from a generic configuration container.
protected parseConfigurationArray ( string $objectName, array $rawConfigurationOptions, string $configurationSourceHint = '', Configuration $existingObjectConfiguration = null ) : Configuration
$objectName string Name of the object
$rawConfigurationOptions array The configuration array with options for the object configuration
$configurationSourceHint string A human readable hint on the original source of the configuration (for troubleshooting)
$existingObjectConfiguration Configuration If set, this object configuration object will be used instead of creating a fresh one
return Configuration The object configuration object

parsePropertyOfTypeObject() protected method

Parses the configuration for properties of type OBJECT
protected parsePropertyOfTypeObject ( string $propertyName, mixed $objectNameOrConfiguration, Configuration $parentObjectConfiguration ) : ConfigurationProperty
$propertyName string Name of the property
$objectNameOrConfiguration mixed Value of the "object" section of the property configuration - either a string or an array
$parentObjectConfiguration Configuration The Configuration object this property belongs to
return ConfigurationProperty A configuration property of type object

parseScope() protected method

Parses the value of the option "scope"
protected parseScope ( string $value ) : integer
$value string Value of the option
return integer The scope translated into a Configuration::SCOPE_* constant

Property Details

$reflectionService protected property

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

$systemLogger protected property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface