Class

Symfony\Component\Config\Definition\BaseNode

abstract class BaseNode implements NodeInterface

The base node class

Methods

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

Constructor.

setAttribute($key, $value)

getAttribute($key, $default = null)

hasAttribute($key)

getAttributes()

setAttributes(array $attributes)

removeAttribute($key)

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.

NodeInterface|null getParent()

Returns parent node for this node.

mixed finalize(mixed $value)

Finalizes a value, applying all finalization closures.

Details

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

Parameters

$key
$value

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

Parameters

$key
$default

at line 62
public hasAttribute($key)

Parameters

$key

at line 67
public getAttributes()

at line 72
public setAttributes(array $attributes)

Parameters

array $attributes

at line 77
public removeAttribute($key)

Parameters

$key

at line 87
public setInfo(string $info)

Sets an info message.

Parameters

string $info

at line 97
public string getInfo()

Returns info message.

Return Value

string The info text

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

Sets the example configuration for this node.

Parameters

string|array $example

at line 117
public string|array getExample()

Retrieves the example configuration for this node.

Return Value

string|array The example

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

Adds an equivalent value.

Parameters

mixed $originalValue
mixed $equivalentValue

at line 138
public setRequired(bool $boolean)

Set this node as required.

Parameters

bool $boolean Required node

at line 148
public setAllowOverwrite(bool $allow)

Sets if this node can be overridden.

Parameters

bool $allow

at line 158
public setNormalizationClosures(array $closures)

Sets the closures used for normalization.

Parameters

array $closures An array of Closures used for normalization

at line 168
public setFinalValidationClosures(array $closures)

Sets the closures used for final validation.

Parameters

array $closures An array of Closures used for final validation

at line 178
public bool isRequired()

Checks if this node is required.

Return Value

bool If the node is required

at line 188
public string getName()

Returns the name of this node

Return Value

string The Node's name.

at line 198
public string getPath()

Retrieves the path of this node.

Return Value

string The Node's path

at line 219
final public mixed merge(mixed $leftSide, mixed $rightSide)

Merges two values together.

Parameters

mixed $leftSide
mixed $rightSide

Return Value

mixed The merged value

Exceptions

ForbiddenOverwriteException

at line 243
final public mixed normalize(mixed $value)

Normalizes a value, applying all normalization closures.

Parameters

mixed $value Value to normalize.

Return Value

mixed The normalized value.

at line 283
public NodeInterface|null getParent()

Returns parent node for this node.

Return Value

NodeInterface|null

at line 297
final public 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

InvalidConfigurationException