Documentation

ContainerBagInterface extends ContainerInterface

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

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

all()  : array<string|int, mixed>
Gets the service container parameters.
escapeValue()  : mixed
Escape parameter placeholders %.
get()  : mixed
Finds an entry of the container by its identifier and returns it.
has()  : bool
Returns true if the container can return an entry for the given identifier.
resolveValue()  : mixed
Replaces parameter placeholders (%name%) by their values.
unescapeValue()  : mixed
Unescape parameter placeholders %.

Methods

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

has()

Returns true if the container can return an entry for the given identifier.

public has(string $id) : bool

Returns false otherwise.

has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.

Parameters
$id : string

Identifier of the entry to look for.

Return values
bool

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

unescapeValue()

Unescape parameter placeholders %.

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

Search results