ContainerBag
extends FrozenParameterBag
in package
implements
ContainerBagInterface
Holds read-only parameters.
Tags
Table of Contents
Interfaces
- ContainerBagInterface
- ContainerBagInterface is the interface implemented by objects that manage service container parameters.
Properties
- $deprecatedParameters : array<string|int, mixed>
- $parameters : mixed
- $resolved : mixed
- $container : Container
Methods
- __construct() : mixed
- For performance reasons, the constructor assumes that all keys are already lowercased.
- add() : never
- Adds parameters to the service container parameters.
- all() : array<string|int, mixed>
- Gets the service container parameters.
- allDeprecated() : array<string|int, mixed>
- clear() : never
- Clears all parameters.
- deprecate() : never
- Deprecates a service container parameter.
- escapeValue() : mixed
- Escape parameter placeholders %.
- get() : array<string|int, mixed>|bool|string|int|float|UnitEnum|null
- Gets a service container parameter.
- has() : bool
- Returns true if a parameter name is defined.
- isResolved() : bool
- remove() : never
- Removes a parameter.
- resolve() : void
- Replaces parameter placeholders (%name%) by their values for all parameters.
- resolveString() : mixed
- Resolves parameters inside a string.
- resolveValue() : mixed
- Replaces parameter placeholders (%name%) by their values.
- set() : never
- Sets a service container parameter.
- unescapeValue() : mixed
- Unescape parameter placeholders %.
Properties
$deprecatedParameters
protected
array<string|int, mixed>
$deprecatedParameters
= []
$parameters
protected
mixed
$parameters
= []
$resolved
protected
mixed
$resolved
= false
$container
private
Container
$container
Methods
__construct()
For performance reasons, the constructor assumes that all keys are already lowercased.
public
__construct(Container $container) : mixed
This is always the case when used internally.
Parameters
- $container : Container
add()
Adds parameters to the service container parameters.
public
add(array<string|int, mixed> $parameters) : never
Parameters
- $parameters : array<string|int, mixed>
Return values
neverall()
Gets the service container parameters.
public
all() : array<string|int, mixed>
Return values
array<string|int, mixed>allDeprecated()
public
allDeprecated() : array<string|int, mixed>
Return values
array<string|int, mixed>clear()
Clears all parameters.
public
clear() : never
Return values
neverdeprecate()
Deprecates a service container parameter.
public
deprecate(string $name, string $package, string $version[, string $message = 'The parameter "%s" is deprecated.' ]) : never
Parameters
- $name : string
- $package : string
- $version : string
- $message : string = 'The parameter "%s" is deprecated.'
Return values
neverescapeValue()
Escape parameter placeholders %.
public
escapeValue(mixed $value) : mixed
Parameters
- $value : mixed
get()
Gets a service container parameter.
public
get(string $name) : array<string|int, mixed>|bool|string|int|float|UnitEnum|null
Parameters
- $name : string
Return values
array<string|int, mixed>|bool|string|int|float|UnitEnum|nullhas()
Returns true if a parameter name is defined.
public
has(string $name) : bool
Parameters
- $name : string
Return values
boolisResolved()
public
isResolved() : bool
Return values
boolremove()
Removes a parameter.
public
remove(string $name) : never
Parameters
- $name : string
Return values
neverresolve()
Replaces parameter placeholders (%name%) by their values for all parameters.
public
resolve() : void
resolveString()
Resolves parameters inside a string.
public
resolveString(string $value[, array<string|int, mixed> $resolving = [] ]) : mixed
Parameters
- $value : string
- $resolving : array<string|int, mixed> = []
-
An array of keys that are being resolved (used internally to detect circular references)
Tags
resolveValue()
Replaces parameter placeholders (%name%) by their values.
public
resolveValue(TValue $value[, array<string|int, mixed> $resolving = [] ]) : mixed
Parameters
- $value : TValue
- $resolving : array<string|int, mixed> = []
-
An array of keys that are being resolved (used internally to detect circular references)
Tags
set()
Sets a service container parameter.
public
set(string $name, array<string|int, mixed>|bool|string|int|float|UnitEnum|null $value) : never
Parameters
- $name : string
- $value : array<string|int, mixed>|bool|string|int|float|UnitEnum|null
Return values
neverunescapeValue()
Unescape parameter placeholders %.
public
unescapeValue(mixed $value) : mixed
Parameters
- $value : mixed