class BaseNode implements NodeInterface

The base node class.

Methods

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

Constructor.

setAttribute($key, $value)

No description

getAttribute($key, $default = null)

No description

hasAttribute($key)

No description

getAttributes()

No description

setAttributes(array $attributes)

No description

removeAttribute($key)

No description

setInfo(string $info)

Sets an info message.

string
getInfo()

Returns info message.

setExample(string|array $example)

Sets the example configuration for this node.

string|array
getExample()

Retrieves the example configuration for this node.

addEquivalentValue(mixed $originalValue, mixed $equivalentValue)

Adds an equivalent value.

setRequired(bool $boolean)

Set this node as required.

setAllowOverwrite(bool $allow)

Sets if this node can be overridden.

setNormalizationClosures(array $closures)

Sets the closures used for normalization.

setFinalValidationClosures(array $closures)

Sets the closures used for final validation.

bool
isRequired()

Checks if this node is required.

string
getName()

Returns the name of this node.

string
getPath()

Retrieves the path of this node.

mixed
merge(mixed $leftSide, mixed $rightSide)

Merges two values together.

mixed
normalize(mixed $value)

Normalizes a value, applying all normalization closures.

getParent()

Returns parent node for this node.

mixed
finalize(mixed $value)

Finalizes a value, applying all finalization closures.

Details

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.

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

Parameters

$key
$value

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

Parameters

$key
$default

at line line 63
hasAttribute($key)

Parameters

$key

at line line 68
getAttributes()

at line line 73
setAttributes(array $attributes)

Parameters

array $attributes

at line line 78
removeAttribute($key)

Parameters

$key

at line line 88
setInfo(string $info)

Sets an info message.

Parameters

string $info

at line line 98
string getInfo()

Returns info message.

Return Value

string The info text

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

Sets the example configuration for this node.

Parameters

string|array $example

at line line 118
string|array getExample()

Retrieves the example configuration for this node.

Return Value

string|array The example

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

Adds an equivalent value.

Parameters

mixed $originalValue
mixed $equivalentValue

at line line 139
setRequired(bool $boolean)

Set this node as required.

Parameters

bool $boolean Required node

at line line 149
setAllowOverwrite(bool $allow)

Sets if this node can be overridden.

Parameters

bool $allow

at line line 159
setNormalizationClosures(array $closures)

Sets the closures used for normalization.

Parameters

array $closures An array of Closures used for normalization

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

at line line 179
bool isRequired()

Checks if this node is required.

Return Value

bool If the node is required

at line line 189
string getName()

Returns the name of this node.

Return Value

string The name of the node

at line line 199
string getPath()

Retrieves the path of this node.

Return Value

string The node path

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

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

at line line 284
NodeInterface|null getParent()

Returns parent node for this node.

Return Value

NodeInterface|null

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