ConfigPostProcessor
in package
Table of Contents
- $exactReplacements : array<string|int, mixed>
- $replacements : Replacements
- $rulesets : array<string|int, callable>
- __construct() : mixed
- __invoke() : array<string|int, mixed>
- merge() : array<string|int, mixed>
- Merge two arrays together.
- fallbackReplacement() : mixed
- Replace a value using the translation table, if the value is a string.
- noopReplacement() : mixed
- replace() : mixed
- Perform substitutions as needed on an individual value.
- replaceDependencyAliases() : array<string|int, mixed>
- Rewrite dependency aliases array
- replaceDependencyConfiguration() : mixed
- replaceDependencyFactories() : mixed
- replaceDependencyInvokables() : array<string|int, mixed>
- Rewrite dependency invokables array
- replaceDependencyServices() : mixed
- replaceExactValue() : mixed
- Replace a value matched exactly.
- replacementRuleMatch() : callable
Properties
$exactReplacements
private
array<string|int, mixed>
$exactReplacements
= ['zend-expressive' => 'mezzio', 'zf-apigility' => 'api-tools']
String keys => string values
$replacements
private
Replacements
$replacements
$rulesets
private
array<string|int, callable>
$rulesets
Methods
__construct()
public
__construct() : mixed
Return values
mixed —__invoke()
public
__invoke(array<string|int, mixed> $config[, array<string|int, string> $keys = [] ]) : array<string|int, mixed>
Parameters
- $config : array<string|int, mixed>
- $keys : array<string|int, string> = []
-
Hierarchy of keys, for determining location in nested configuration.
Return values
array<string|int, mixed> —merge()
Merge two arrays together.
public
static merge(array<string|int, mixed> $a, array<string|int, mixed> $b) : array<string|int, mixed>
If an integer key exists in both arrays, the value from the second array will be appended to the first array. If both values are arrays, they are merged together, else the value of the second array overwrites the one of the first array.
Based on zend-stdlib Zend\Stdlib\ArrayUtils::merge
Parameters
- $a : array<string|int, mixed>
- $b : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —fallbackReplacement()
Replace a value using the translation table, if the value is a string.
private
fallbackReplacement(mixed $value) : mixed
Parameters
- $value : mixed
Return values
mixed —noopReplacement()
private
noopReplacement(mixed $value) : mixed
Parameters
- $value : mixed
Return values
mixed —Returns $value verbatim.
replace()
Perform substitutions as needed on an individual value.
private
replace(mixed $value, array<string|int, string> $keys[, null|int|string $key = null ]) : mixed
The $key is provided to allow fine-grained selection of rewrite rules.
Parameters
- $value : mixed
- $keys : array<string|int, string>
-
Key hierarchy
- $key : null|int|string = null
Return values
mixed —replaceDependencyAliases()
Rewrite dependency aliases array
private
replaceDependencyAliases(array<string|int, mixed> $aliases) : array<string|int, mixed>
In this case, we want to keep the alias as-is, but rewrite the target.
We need also provide an additional alias if the alias key is a legacy class.
Parameters
- $aliases : array<string|int, mixed>
Return values
array<string|int, mixed> —replaceDependencyConfiguration()
private
replaceDependencyConfiguration(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
Return values
mixed —replaceDependencyFactories()
private
replaceDependencyFactories(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
Return values
mixed —replaceDependencyInvokables()
Rewrite dependency invokables array
private
replaceDependencyInvokables(array<string|int, mixed> $config) : array<string|int, mixed>
In this case, we want to keep the alias as-is, but rewrite the target.
We need also provide an additional alias if invokable is defined with an alias which is a legacy class.
Parameters
- $config : array<string|int, mixed>
Return values
array<string|int, mixed> —replaceDependencyServices()
private
replaceDependencyServices(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
Return values
mixed —replaceExactValue()
Replace a value matched exactly.
private
replaceExactValue(mixed $value) : mixed
Parameters
- $value : mixed
Return values
mixed —replacementRuleMatch()
private
replacementRuleMatch(mixed $value[, null|int|string $key = null ]) : callable
Parameters
- $value : mixed
- $key : null|int|string = null
Return values
callable —Callable to invoke with value