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.

setDeprecated(string|null $message)

Sets this node as deprecated.

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.

bool
isDeprecated()

Checks if this node is deprecated.

string
getDeprecationMessage(string $node, string $path)

Returns the deprecated message.

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 42
__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 52
setAttribute($key, $value)

Parameters

$key
$value

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

Parameters

$key
$default

at line line 62
hasAttribute($key)

Parameters

$key

at line line 67
getAttributes()

at line line 72
setAttributes(array $attributes)

Parameters

array $attributes

at line line 77
removeAttribute($key)

Parameters

$key

at line line 87
setInfo(string $info)

Sets an info message.

Parameters

string $info

at line line 97
string getInfo()

Returns info message.

Return Value

string The info text

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

Sets the example configuration for this node.

Parameters

string|array $example

at line line 117
string|array getExample()

Retrieves the example configuration for this node.

Return Value

string|array The example

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

Adds an equivalent value.

Parameters

mixed $originalValue
mixed $equivalentValue

at line line 138
setRequired(bool $boolean)

Set this node as required.

Parameters

bool $boolean Required node

at line line 151
setDeprecated(string|null $message)

Sets this node as deprecated.

You can use %node% and %path% placeholders in your message to display, respectively, the node name and its complete path.

Parameters

string|null $message Deprecated message

at line line 161
setAllowOverwrite(bool $allow)

Sets if this node can be overridden.

Parameters

bool $allow

at line line 171
setNormalizationClosures(array $closures)

Sets the closures used for normalization.

Parameters

array $closures An array of Closures used for normalization

at line line 181
setFinalValidationClosures(array $closures)

Sets the closures used for final validation.

Parameters

array $closures An array of Closures used for final validation

at line line 191
bool isRequired()

Checks if this node is required.

Return Value

bool If the node is required

at line line 201
bool isDeprecated()

Checks if this node is deprecated.

Return Value

bool

at line line 214
string getDeprecationMessage(string $node, string $path)

Returns the deprecated message.

Parameters

string $node the configuration node name
string $path the path of the node

Return Value

string

at line line 224
string getName()

Returns the name of this node.

Return Value

string The name of the node

at line line 234
string getPath()

Retrieves the path of this node.

Return Value

string The node path

at line line 255
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 279
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 319
NodeInterface|null getParent()

Returns parent node for this node.

Return Value

NodeInterface|null

at line line 334
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