class EnvPlaceholderParameterBag extends ParameterBag

Properties

protected $parameters from ParameterBag
protected $resolved from ParameterBag

Methods

__construct(array $parameters = [])

No description

clear()

Clears all parameters.

add(array $parameters)

Adds parameters to the service container parameters.

array
all()

Gets the service container parameters.

mixed
get(string $name)

Gets a service container parameter.

set(string $name, mixed $value)

Sets a service container parameter.

bool
has(string $name)

Returns true if a parameter name is defined.

remove(string $name)

Removes a parameter.

resolve()

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

resolveValue(mixed $value, array $resolving = [])

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

string
resolveString(string $value, array $resolving = [])

Resolves parameters inside a string.

isResolved()

No description

mixed
escapeValue(mixed $value)

Escape parameter placeholders %.

mixed
unescapeValue(mixed $value)

Unescape parameter placeholders %.

string
getEnvPlaceholderUniquePrefix()

Gets the common env placeholder prefix for env vars created by this bag.

string[][]
getEnvPlaceholders()

Returns the map of env vars used in the resolved parameter values to their placeholders.

array
getUnusedEnvPlaceholders()

No description

clearUnusedEnvPlaceholders()

No description

mergeEnvPlaceholders(EnvPlaceholderParameterBag $bag)

Merges the env placeholders of another EnvPlaceholderParameterBag.

setProvidedTypes(array $providedTypes)

Maps env prefixes to their corresponding PHP types.

string[][]
getProvidedTypes()

Gets the PHP types corresponding to env() parameter prefixes.

Details

in ParameterBag at line 31
__construct(array $parameters = [])

Parameters

array $parameters An array of parameters

in ParameterBag at line 39
clear()

Clears all parameters.

in ParameterBag at line 49
add(array $parameters)

Adds parameters to the service container parameters.

Parameters

array $parameters An array of parameters

in ParameterBag at line 59
array all()

Gets the service container parameters.

Return Value

array An array of parameters

at line 30
mixed get(string $name)

Gets a service container parameter.

Parameters

string $name The parameter name

Return Value

mixed The parameter value

Exceptions

ParameterNotFoundException if the parameter is not defined

in ParameterBag at line 112
set(string $name, mixed $value)

Sets a service container parameter.

Parameters

string $name The parameter name
mixed $value The parameter value

in ParameterBag at line 120
bool has(string $name)

Returns true if a parameter name is defined.

Parameters

string $name The parameter name

Return Value

bool true if the parameter name is defined, false otherwise

in ParameterBag at line 130
remove(string $name)

Removes a parameter.

Parameters

string $name The parameter name

at line 138
resolve()

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

in ParameterBag at line 172
resolveValue(mixed $value, array $resolving = [])

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

Parameters

mixed $value A value
array $resolving An array of keys that are being resolved (used internally to detect circular references)

Exceptions

ParameterNotFoundException if a placeholder references a parameter that does not exist
ParameterCircularReferenceException if a circular reference if detected
RuntimeException when a given parameter has a type problem

in ParameterBag at line 202
string resolveString(string $value, array $resolving = [])

Resolves parameters inside a string.

Parameters

string $value The string to resolve
array $resolving An array of keys that are being resolved (used internally to detect circular references)

Return Value

string The resolved string

Exceptions

ParameterNotFoundException if a placeholder references a parameter that does not exist
ParameterCircularReferenceException if a circular reference if detected
RuntimeException when a given parameter has a type problem

in ParameterBag at line 243
isResolved()

in ParameterBag at line 251
mixed escapeValue(mixed $value)

Escape parameter placeholders %.

Parameters

mixed $value

Return Value

mixed

in ParameterBag at line 272
mixed unescapeValue(mixed $value)

Unescape parameter placeholders %.

Parameters

mixed $value

Return Value

mixed

at line 70
string getEnvPlaceholderUniquePrefix()

Gets the common env placeholder prefix for env vars created by this bag.

Return Value

string

at line 80
string[][] getEnvPlaceholders()

Returns the map of env vars used in the resolved parameter values to their placeholders.

Return Value

string[][] A map of env var names to their placeholders

at line 85
array getUnusedEnvPlaceholders()

Return Value

array

at line 90
clearUnusedEnvPlaceholders()

at line 98
mergeEnvPlaceholders(EnvPlaceholderParameterBag $bag)

Merges the env placeholders of another EnvPlaceholderParameterBag.

Parameters

EnvPlaceholderParameterBag $bag

at line 120
setProvidedTypes(array $providedTypes)

Maps env prefixes to their corresponding PHP types.

Parameters

array $providedTypes

at line 130
string[][] getProvidedTypes()

Gets the PHP types corresponding to env() parameter prefixes.

Return Value

string[][]