Documentation

FrozenParameterBag extends ParameterBag
in package

Holds read-only parameters.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

Properties

$deprecatedParameters  : array<string|int, mixed>
$parameters  : mixed
$resolved  : mixed

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 = []

Methods

__construct()

For performance reasons, the constructor assumes that all keys are already lowercased.

public __construct([array<string|int, mixed> $parameters = [] ][, array<string|int, mixed> $deprecatedParameters = [] ]) : mixed

This is always the case when used internally.

Parameters
$parameters : array<string|int, mixed> = []
$deprecatedParameters : array<string|int, mixed> = []

add()

Adds parameters to the service container parameters.

public add(array<string|int, mixed> $parameters) : never
Parameters
$parameters : array<string|int, mixed>
Return values
never

all()

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>

deprecate()

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
never

escapeValue()

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|null

has()

Returns true if a parameter name is defined.

public has(string $name) : bool
Parameters
$name : string
Return values
bool

isResolved()

public isResolved() : bool
Return values
bool

remove()

Removes a parameter.

public remove(string $name) : never
Parameters
$name : string
Return values
never

resolve()

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
throws
ParameterNotFoundException

if a placeholder references a parameter that does not exist

throws
ParameterCircularReferenceException

if a circular reference if detected

throws
RuntimeException

when a given parameter has a type problem

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
template
psalm-return

(TValue is scalar ? array|scalar : array<array|scalar>)

throws
ParameterNotFoundException

if a placeholder references a parameter that does not exist

throws
ParameterCircularReferenceException

if a circular reference if detected

throws
RuntimeException

when a given parameter has a type problem

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
never

unescapeValue()

Unescape parameter placeholders %.

public unescapeValue(mixed $value) : mixed
Parameters
$value : mixed

        
On this page

Search results