class BaseNode implements NodeInterface

The base node class.

Methods

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

No description

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 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

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

Parameters

$key
$value

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

Parameters

$key
$default

at line line 61
hasAttribute($key)

Parameters

$key

at line line 66
getAttributes()

at line line 71
setAttributes(array $attributes)

Parameters

array $attributes

at line line 76
removeAttribute($key)

Parameters

$key

at line line 86
setInfo(string $info)

Sets an info message.

Parameters

string $info

at line line 96
string getInfo()

Returns info message.

Return Value

string The info text

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

Sets the example configuration for this node.

Parameters

string|array $example

at line line 116
string|array getExample()

Retrieves the example configuration for this node.

Return Value

string|array The example

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

Adds an equivalent value.

Parameters

mixed $originalValue
mixed $equivalentValue

at line line 137
setRequired(bool $boolean)

Set this node as required.

Parameters

bool $boolean Required node

at line line 147
setAllowOverwrite(bool $allow)

Sets if this node can be overridden.

Parameters

bool $allow

at line line 157
setNormalizationClosures(array $closures)

Sets the closures used for normalization.

Parameters

array $closures An array of Closures used for normalization

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

at line line 177
bool isRequired()

Checks if this node is required.

Return Value

bool If the node is required

at line line 187
string getName()

Returns the name of this node.

Return Value

string The name of the node

at line line 197
string getPath()

Retrieves the path of this node.

Return Value

string The node path

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

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

at line line 282
NodeInterface|null getParent()

Returns parent node for this node.

Return Value

NodeInterface|null

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