Documentation

EnvPlaceholderParameterBag extends ParameterBag
in package

Holds parameters.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

$parameters  : mixed
$resolved  : mixed
$counter  : mixed
$envPlaceholders  : mixed
$envPlaceholderUniquePrefix  : mixed
$providedTypes  : mixed
$unusedEnvPlaceholders  : mixed
__construct()  : mixed
add()  : mixed
Adds parameters to the service container parameters.
all()  : array<string|int, mixed>
Gets the service container parameters.
clear()  : mixed
Clears all parameters.
clearUnusedEnvPlaceholders()  : mixed
escapeValue()  : mixed
Escape parameter placeholders %.
get()  : array<string|int, mixed>|bool|string|int|float|UnitEnum|null
Gets a service container parameter.
getEnvPlaceholders()  : array<string|int, array<string|int, string>>
Returns the map of env vars used in the resolved parameter values to their placeholders.
getEnvPlaceholderUniquePrefix()  : string
Gets the common env placeholder prefix for env vars created by this bag.
getProvidedTypes()  : array<string|int, array<string|int, string>>
Gets the PHP types corresponding to env() parameter prefixes.
getUnusedEnvPlaceholders()  : array<string|int, mixed>
has()  : bool
Returns true if a parameter name is defined.
isResolved()  : mixed
mergeEnvPlaceholders()  : mixed
Merges the env placeholders of another EnvPlaceholderParameterBag.
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.
setProvidedTypes()  : mixed
Maps env prefixes to their corresponding PHP types.
unescapeValue()  : mixed
Unescape parameter placeholders %.

Properties

Methods

__construct()

public __construct([array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
$parameters : array<string|int, mixed> = []
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()

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

getEnvPlaceholders()

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

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

A map of env var names to their placeholders

getEnvPlaceholderUniquePrefix()

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

public getEnvPlaceholderUniquePrefix() : string
Return values
string

getProvidedTypes()

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

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

getUnusedEnvPlaceholders()

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

has()

Returns true if a parameter name is defined.

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

isResolved()

public isResolved() : mixed
Return values
mixed

mergeEnvPlaceholders()

Merges the env placeholders of another EnvPlaceholderParameterBag.

public mergeEnvPlaceholders(self $bag) : mixed
Parameters
$bag : self
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

setProvidedTypes()

Maps env prefixes to their corresponding PHP types.

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

unescapeValue()

Unescape parameter placeholders %.

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

Search results