Documentation

ParameterBagInterface

ParameterBagInterface is the interface implemented by objects that manage service container parameters.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

add()  : mixed
Adds parameters to the service container parameters.
all()  : array<string|int, mixed>
Gets the service container parameters.
clear()  : mixed
Clears all parameters.
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.
remove()  : mixed
Removes a parameter.
resolve()  : mixed
Replaces parameter placeholders (%name%) by their values for all parameters.
resolveValue()  : mixed
Replaces parameter placeholders (%name%) by their values.
set()  : mixed
Sets a service container parameter.
unescapeValue()  : mixed
Unescape parameter placeholders %.

Methods

add()

Adds parameters to the service container parameters.

public add(array<string|int, mixed> $parameters) : mixed
Parameters
$parameters : array<string|int, mixed>
Tags
throws
LogicException

if the parameter cannot be added

Return values
mixed

all()

Gets the service container parameters.

public all() : array<string|int, mixed>
Return values
array<string|int, mixed>

escapeValue()

Escape parameter placeholders %.

public escapeValue(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

get()

Gets a service container parameter.

public get(string $name) : array<string|int, mixed>|bool|string|int|float|UnitEnum|null
Parameters
$name : string
Tags
throws
ParameterNotFoundException

if the parameter is not defined

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

remove()

Removes a parameter.

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

resolve()

Replaces parameter placeholders (%name%) by their values for all parameters.

public resolve() : mixed
Return values
mixed

resolveValue()

Replaces parameter placeholders (%name%) by their values.

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

A value

Tags
throws
ParameterNotFoundException

if a placeholder references a parameter that does not exist

Return values
mixed

set()

Sets a service container parameter.

public set(string $name, array<string|int, mixed>|bool|string|int|float|UnitEnum|null $value) : mixed
Parameters
$name : string
$value : array<string|int, mixed>|bool|string|int|float|UnitEnum|null

The parameter value

Tags
throws
LogicException

if the parameter cannot be set

Return values
mixed

unescapeValue()

Unescape parameter placeholders %.

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

Search results