SymfonyConfigFactory
Tags
Table of Contents
Constants
- FIELD_CONFIG_VERSION : mixed = 'configVersion'
- DEFAULT_CONFIG_VERSION : mixed = '2'
Properties
- $configurationDefinitions : ConfigurationInterface[]
Methods
- __construct() : mixed
- createDefault() : ConfigurationMap
- createFromFile() : ConfigurationMap
- findDefinition() : ConfigurationInterface
- generateConfiguration() : ConfigurationMap
- processConfiguration() : array
- Normalizes and validates the given values.
- upgradeConfiguration() : array
Constants
FIELD_CONFIG_VERSION
public
final mixed
FIELD_CONFIG_VERSION
= 'configVersion'
DEFAULT_CONFIG_VERSION
private
mixed
DEFAULT_CONFIG_VERSION
= '2'
Properties
$configurationDefinitions
private
ConfigurationInterface[]
$configurationDefinitions
Methods
__construct()
public
__construct(ConfigurationInterface[] $definitions) : mixed
Parameters
- $definitions : ConfigurationInterface[]
createDefault()
public
createDefault() : ConfigurationMap
Return values
ConfigurationMapcreateFromFile()
public
createFromFile(string $filename) : ConfigurationMap
Parameters
- $filename : string
Return values
ConfigurationMapfindDefinition()
private
findDefinition(string $configurationVersion) : ConfigurationInterface
Parameters
- $configurationVersion : string
Return values
ConfigurationInterfacegenerateConfiguration()
private
generateConfiguration(array $values) : ConfigurationMap
Parameters
- $values : array
Return values
ConfigurationMapprocessConfiguration()
Normalizes and validates the given values.
private
processConfiguration(array $values) : array
When this version of the configuration can be upgraded (which is detected by the Upgradable interface on the Configuration definition) then it will do so and re-run this method with the upgraded values. The 'configVersion' field will tell which definition should be used; when none is provided then a version 2 configuration is assumed.
Parameters
- $values : array
-
because this method is called recursively, the provided shape varies and is the output of the ConfigurationDefinition matching the prior configVersion is used.
Return values
array —the recursiveness of this method means that the output of this method has the shape of the current ConfigurationDefinition's output.
upgradeConfiguration()
private
upgradeConfiguration(Upgradable $definition, array $configuration) : array
Parameters
- $definition : Upgradable
- $configuration : array
-
because this method is called as part of the recursive method processConfiguration, the provided shape varies and is the output of the normalisation process of provided ConfigurationDefinition.
Return values
array —this method's output will match the shape of the output of the provided ConfigurationDefinition.