class VariableNode extends BaseNode implements PrototypeNodeInterface

This node represents a value of variable type in the config tree.

This node is intended for values of arbitrary type. Any PHP type is accepted as a value.

Methods

__construct(string $name, NodeInterface $parent = null)

Constructor.

from BaseNode
setAttribute($key, $value)

No description

from BaseNode
getAttribute($key, $default = null)

No description

from BaseNode
hasAttribute($key)

No description

from BaseNode
getAttributes()

No description

from BaseNode
setAttributes(array $attributes)

No description

from BaseNode
removeAttribute($key)

No description

from BaseNode
setInfo(string $info)

Sets an info message.

from BaseNode
string
getInfo()

Returns info message.

from BaseNode
setExample(string|array $example)

Sets the example configuration for this node.

from BaseNode
string|array
getExample()

Retrieves the example configuration for this node.

from BaseNode
addEquivalentValue(mixed $originalValue, mixed $equivalentValue)

Adds an equivalent value.

from BaseNode
setRequired(bool $boolean)

Set this node as required.

from BaseNode
setAllowOverwrite(bool $allow)

Sets if this node can be overridden.

from BaseNode
setNormalizationClosures(array $closures)

Sets the closures used for normalization.

from BaseNode
setFinalValidationClosures(array $closures)

Sets the closures used for final validation.

from BaseNode
bool
isRequired()

Checks if this node is required.

from BaseNode
string
getName()

Returns the name of this node.

from BaseNode
string
getPath()

Retrieves the path of this node.

from BaseNode
mixed
merge(mixed $leftSide, mixed $rightSide)

Merges two values together.

from BaseNode
mixed
normalize(mixed $value)

Normalizes a value, applying all normalization closures.

from BaseNode
getParent()

Returns parent node for this node.

from BaseNode
mixed
finalize(mixed $value)

Finalizes a value, applying all finalization closures.

from BaseNode
setDefaultValue($value)

{@inheritdoc}

bool
hasDefaultValue()

Returns true when the node has a default value.

mixed
getDefaultValue()

Returns the default value of the node.

setAllowEmptyValue(bool $boolean)

Sets if this node is allowed to have an empty value.

setName(string $name)

Sets the name of the node.

Details

in BaseNode at line line 43
__construct(string $name, NodeInterface $parent = null)

Constructor.

Parameters

string $name The name of the node
NodeInterface $parent The parent of this node

Exceptions

InvalidArgumentException if the name contains a period.

in BaseNode at line line 53
setAttribute($key, $value)

Parameters

$key
$value

in BaseNode at line line 58
getAttribute($key, $default = null)

Parameters

$key
$default

in BaseNode at line line 63
hasAttribute($key)

Parameters

$key

in BaseNode at line line 68
getAttributes()

in BaseNode at line line 73
setAttributes(array $attributes)

Parameters

array $attributes

in BaseNode at line line 78
removeAttribute($key)

Parameters

$key

in BaseNode at line line 88
setInfo(string $info)

Sets an info message.

Parameters

string $info

in BaseNode at line line 98
string getInfo()

Returns info message.

Return Value

string The info text

in BaseNode at line line 108
setExample(string|array $example)

Sets the example configuration for this node.

Parameters

string|array $example

in BaseNode at line line 118
string|array getExample()

Retrieves the example configuration for this node.

Return Value

string|array The example

in BaseNode at line line 129
addEquivalentValue(mixed $originalValue, mixed $equivalentValue)

Adds an equivalent value.

Parameters

mixed $originalValue
mixed $equivalentValue

in BaseNode at line line 139
setRequired(bool $boolean)

Set this node as required.

Parameters

bool $boolean Required node

in BaseNode at line line 149
setAllowOverwrite(bool $allow)

Sets if this node can be overridden.

Parameters

bool $allow

in BaseNode at line line 159
setNormalizationClosures(array $closures)

Sets the closures used for normalization.

Parameters

array $closures An array of Closures used for normalization

in BaseNode at line line 169
setFinalValidationClosures(array $closures)

Sets the closures used for final validation.

Parameters

array $closures An array of Closures used for final validation

in BaseNode at line line 179
bool isRequired()

Checks if this node is required.

Return Value

bool If the node is required

in BaseNode at line line 189
string getName()

Returns the name of this node.

Return Value

string The name of the node

in BaseNode at line line 199
string getPath()

Retrieves the path of this node.

Return Value

string The node path

in BaseNode at line line 220
final mixed merge(mixed $leftSide, mixed $rightSide)

Merges two values together.

Parameters

mixed $leftSide
mixed $rightSide

Return Value

mixed The merged values

Exceptions

ForbiddenOverwriteException

in BaseNode at line line 244
final mixed normalize(mixed $value)

Normalizes a value, applying all normalization closures.

Parameters

mixed $value The value to normalize

Return Value

mixed The normalized value

in BaseNode at line line 284
NodeInterface|null getParent()

Returns parent node for this node.

Return Value

NodeInterface|null

in BaseNode at line line 299
final mixed finalize(mixed $value)

Finalizes a value, applying all finalization closures.

Parameters

mixed $value The value to finalize

Return Value

mixed The finalized value

Exceptions

Exception
InvalidConfigurationException

at line line 33
setDefaultValue($value)

{@inheritdoc}

Parameters

$value

at line line 42
bool hasDefaultValue()

Returns true when the node has a default value.

Return Value

bool If the node has a default value

at line line 50
mixed getDefaultValue()

Returns the default value of the node.

Return Value

mixed The default value

Exceptions

RuntimeException if the node has no default value

at line line 62
setAllowEmptyValue(bool $boolean)

Sets if this node is allowed to have an empty value.

Parameters

bool $boolean True if this entity will accept empty values

at line line 70
setName(string $name)

Sets the name of the node.

Parameters

string $name The name of the node