phpDocumentor

SymfonyConfigFactory
in package

Tags
psalm-import-type

ConfigurationMap from ConfigurationFactory

Table of Contents

FIELD_CONFIG_VERSION  = 'configVersion'
DEFAULT_CONFIG_VERSION  = '2'
$configurationDefinitions  : array<string|int, ConfigurationInterface>
__construct()  : mixed
createDefault()  : ConfigurationMap
createFromFile()  : ConfigurationMap
findDefinition()  : ConfigurationInterface
generateConfiguration()  : ConfigurationMap
processConfiguration()  : array<string|int, mixed>
Normalizes and validates the given values.
upgradeConfiguration()  : array<string|int, mixed>

Constants

Properties

$configurationDefinitions

private array<string|int, ConfigurationInterface> $configurationDefinitions
Tags

Methods

__construct()

public __construct(array<string|int, ConfigurationInterface$definitions) : mixed
Parameters
$definitions : array<string|int, ConfigurationInterface>
Tags
Return values
mixed

createDefault()

public createDefault() : ConfigurationMap
Tags
Return values
ConfigurationMap

createFromFile()

public createFromFile(string $filename) : ConfigurationMap
Parameters
$filename : string
Tags
Return values
ConfigurationMap

findDefinition()

private findDefinition(string $configurationVersion) : ConfigurationInterface
Parameters
$configurationVersion : string
Tags
Return values
ConfigurationInterface

generateConfiguration()

private generateConfiguration(array<string|int, mixed> $values) : ConfigurationMap
Parameters
$values : array<string|int, mixed>
Tags
Return values
ConfigurationMap

processConfiguration()

Normalizes and validates the given values.

private processConfiguration(array<string|int, mixed> $values) : array<string|int, mixed>

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<string|int, mixed>

because this method is called recursively, the provided shape varies and is the output of the ConfigurationDefinition matching the prior configVersion is used.

Tags
Return values
array<string|int, mixed>

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<string|int, mixed> $configuration) : array<string|int, mixed>
Parameters
$definition : Upgradable
$configuration : array<string|int, mixed>

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.

Tags
Return values
array<string|int, mixed>

this method's output will match the shape of the output of the provided ConfigurationDefinition.


        

Search results