class ArrayNode extends BaseNode implements PrototypeNodeInterface

Represents an Array node in the config tree.

Methods

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

No description

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
setNormalizeKeys($normalizeKeys)

No description

array
getChildren()

Retrieves the children of this node.

setXmlRemappings(array $remappings)

Sets the xml remappings that should be performed.

array
getXmlRemappings()

Gets the xml remappings that should be performed.

setAddIfNotSet(bool $boolean)

Sets whether to add default values for this array if it has not been defined in any of the configuration files.

setAllowFalse(bool $allow)

Sets whether false is allowed as value indicating that the array should be unset.

setAllowNewKeys(bool $allow)

Sets whether new keys can be defined in subsequent configurations.

setPerformDeepMerging(bool $boolean)

Sets if deep merging should occur.

setIgnoreExtraKeys(bool $boolean, bool $remove = true)

Whether extra keys should just be ignore without an exception.

setName(string $name)

Sets the node Name.

bool
hasDefaultValue()

Checks if the node has a default value.

mixed
getDefaultValue()

Retrieves the default value.

addChild(NodeInterface $node)

Adds a child node.

Details

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

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 51
setAttribute($key, $value)

Parameters

$key
$value

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

Parameters

$key
$default

in BaseNode at line line 61
hasAttribute($key)

Parameters

$key

in BaseNode at line line 66
getAttributes()

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

Parameters

array $attributes

in BaseNode at line line 76
removeAttribute($key)

Parameters

$key

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

Sets an info message.

Parameters

string $info

in BaseNode at line line 96
string getInfo()

Returns info message.

Return Value

string The info text

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

Sets the example configuration for this node.

Parameters

string|array $example

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

Retrieves the example configuration for this node.

Return Value

string|array The example

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

Adds an equivalent value.

Parameters

mixed $originalValue
mixed $equivalentValue

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

Set this node as required.

Parameters

bool $boolean Required node

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

Sets if this node can be overridden.

Parameters

bool $allow

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

Sets the closures used for normalization.

Parameters

array $closures An array of Closures used for normalization

in BaseNode at line line 167
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 177
bool isRequired()

Checks if this node is required.

Return Value

bool If the node is required

in BaseNode at line line 187
string getName()

Returns the name of this node.

Return Value

string The name of the node

in BaseNode at line line 197
string getPath()

Retrieves the path of this node.

Return Value

string The node path

in BaseNode at line line 218
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 242
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 282
NodeInterface|null getParent()

Returns parent node for this node.

Return Value

NodeInterface|null

in BaseNode at line line 297
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 35
setNormalizeKeys($normalizeKeys)

Parameters

$normalizeKeys

at line line 77
array getChildren()

Retrieves the children of this node.

Return Value

array The children

at line line 87
setXmlRemappings(array $remappings)

Sets the xml remappings that should be performed.

Parameters

array $remappings An array of the form array(array(string, string))

at line line 97
array getXmlRemappings()

Gets the xml remappings that should be performed.

Return Value

array $remappings an array of the form array(array(string, string))

at line line 108
setAddIfNotSet(bool $boolean)

Sets whether to add default values for this array if it has not been defined in any of the configuration files.

Parameters

bool $boolean

at line line 118
setAllowFalse(bool $allow)

Sets whether false is allowed as value indicating that the array should be unset.

Parameters

bool $allow

at line line 128
setAllowNewKeys(bool $allow)

Sets whether new keys can be defined in subsequent configurations.

Parameters

bool $allow

at line line 138
setPerformDeepMerging(bool $boolean)

Sets if deep merging should occur.

Parameters

bool $boolean

at line line 149
setIgnoreExtraKeys(bool $boolean, bool $remove = true)

Whether extra keys should just be ignore without an exception.

Parameters

bool $boolean To allow extra keys
bool $remove To remove extra keys

at line line 160
setName(string $name)

Sets the node Name.

Parameters

string $name The name of the node

at line line 170
bool hasDefaultValue()

Checks if the node has a default value.

Return Value

bool If the node has a default value

at line line 182
mixed getDefaultValue()

Retrieves the default value.

Return Value

mixed The default value

Exceptions

RuntimeException if the node has no default value

at line line 204
addChild(NodeInterface $node)

Adds a child node.

Parameters

NodeInterface $node

Exceptions

InvalidArgumentException when the child node has no name
InvalidArgumentException when the child node's name is not unique