Documentation

ContainerBag extends FrozenParameterBag
in package
implements ContainerBagInterface

Holds read-only parameters.

Tags
author

Nicolas Grekas p@tchwork.com

Interfaces, Classes and Traits

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

Table of Contents

$parameters  : mixed
$resolved  : mixed
$container  : mixed
__construct()  : mixed
For performance reasons, the constructor assumes that all keys are already lowercased.
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
{@inheritdoc}
has()  : bool
{@inheritdoc}
isResolved()  : mixed
remove()  : mixed
Removes a parameter.
resolve()  : mixed
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()  : mixed
Sets a service container parameter.
unescapeValue()  : mixed
Unescape parameter placeholders %.

Properties

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
Return values
mixed

add()

Adds parameters to the service container parameters.

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

all()

Gets the service container parameters.

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

clear()

Clears all parameters.

public clear() : mixed
Return values
mixed

escapeValue()

Escape parameter placeholders %.

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

get()

{@inheritdoc}

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()

{@inheritdoc}

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

isResolved()

public isResolved() : mixed
Return values
mixed

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

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

Return values
mixed

resolveValue()

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

public resolveValue(mixed $value[, array<string|int, mixed> $resolving = [] ]) : mixed
Parameters
$value : mixed

A value

$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

Return values
mixed

set()

Sets a service container parameter.

public set(string $name, mixed $value) : mixed
Parameters
$name : string
$value : mixed

The parameter value

Return values
mixed

unescapeValue()

Unescape parameter placeholders %.

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

Search results