Documentation

VariableBag
in package

Table of Contents

$variables  : array<string|int, mixed>
__construct()  : mixed
__set_state()  : self
all()  : array<string, string|string[]>
assign()  : void
fetch()  : null|string|array<string|int, string>
Fetches the variable value if none found returns null.
replace()  : self
Replaces elements from passed variables into the current instance.
normalizeValue()  : string|array<string|int, string>

Properties

$variables

private array<string|int, mixed> $variables = []

Methods

__construct()

public __construct([iteratable<string, string|bool|int|float|(string|bool|int|float)[]> $variables = [] ]) : mixed
Parameters
$variables : iteratable<string, string|bool|int|float|(string|bool|int|float)[]> = []
Return values
mixed

__set_state()

public static __set_state(array<string|int, mixed> $properties) : self
Parameters
$properties : array<string|int, mixed>
Return values
self

all()

public all() : array<string, string|string[]>
Return values
array<string, string|string[]>

assign()

public assign(string $name, string|bool|int|float|array<string|int, string|bool|int|float> $value) : void
Parameters
$name : string
$value : string|bool|int|float|array<string|int, string|bool|int|float>
Return values
void

fetch()

Fetches the variable value if none found returns null.

public fetch(string $name) : null|string|array<string|int, string>
Parameters
$name : string
Return values
null|string|array<string|int, string>

replace()

Replaces elements from passed variables into the current instance.

public replace(VariableBag $variables) : self
Parameters
$variables : VariableBag
Return values
self

normalizeValue()

private normalizeValue(mixed $value, string $name, bool $isNestedListAllowed) : string|array<string|int, string>
Parameters
$value : mixed

the value to be expanded

$name : string
$isNestedListAllowed : bool
Tags
throws
TemplateCanNotBeExpanded

if the value contains nested list

Return values
string|array<string|int, string>

Search results