| Methods |
public
|
__construct(ExtensionInterface $extension, ParameterBagInterface $parameterBag = null)
|
#
|
public
|
addCompilerPass(
CompilerPassInterface $pass,
string $type = PassConfig::TYPE_BEFORE_OPTIMIZATION,
int $priority = 0,
): static
Adds a compiler pass.
Parameters
| $type |
The type of compiler pass
|
| $priority |
Used to sort the passes
|
Overrides
|
#
|
public
|
registerExtension(ExtensionInterface $extension)
|
#
|
public
|
compile(bool $resolveEnvPlaceholders = false)
Compiles the container.
Compiles the container.
This method passes the container to compiler
passes whose job is to manipulate and optimize
the container.
The main compiler passes roughly do four things:
- The extension configurations are merged;
- Parameter values are resolved;
- The parameter bag is frozen;
- Extension loading is disabled.
Parameters
| $resolveEnvPlaceholders |
Whether %env()% parameters should be resolved using the current
env vars or be replaced by uniquely identifiable placeholders.
Set to "true" when you want to use the current ContainerBuilder
directly, keep to "false" when the container is dumped instead.
|
Overrides
|
#
|
public
|
resolveEnvPlaceholders(mixed $value, string|bool $format = null, array &$usedEnvs = null): mixed
Resolves env parameter placeholders in a string or an array.
Resolves env parameter placeholders in a string or an array.
Parameters
| $format |
A sprintf() format returning the replacement for each env var name or
null to resolve back to the original "%env(VAR)%" format or
true to resolve to the actual values of the referenced env vars
|
| $usedEnvs |
Env vars found while resolving are added to this array
|
Returns
The value with env parameters resolved if a string or an array is passed
Overrides
|
#
|