abstract class BaseNode implements NodeInterface
The base node class.
DEFAULT_PATH_SEPARATOR |
protected | $name | ||
protected | $parent | ||
protected | $normalizationClosures | ||
protected | $finalValidationClosures | ||
protected | $allowOverwrite | ||
protected | $required | ||
protected | $deprecationMessage | ||
protected | $equivalentValues | ||
protected | $attributes | ||
protected | $pathSeparator |
__construct(string|null $name, NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR) | ||
static void | setPlaceholder(string $placeholder, array $values) Register possible (dummy) values for a dynamic placeholder value. | |
static void | setPlaceholderUniquePrefix(string $prefix) Sets a common prefix for dynamic placeholder values. | |
static void | resetPlaceholders() Resets all current placeholders available. | |
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. | ||
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() Returns true when the 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 the node. | |
string | getPath() Returns the path of the node. | |
mixed | merge(mixed $leftSide, mixed $rightSide) Merges two values together. | |
mixed | normalize(mixed $value) Normalizes a value. | |
$value | preNormalize($value) Normalizes the value before any other normalization is applied. | |
NodeInterface|null | getParent() Returns parent node for this node. | |
mixed | finalize(mixed $value) Finalizes a value. | |
validateType(mixed $value) Validates the type of a Node. | ||
mixed | normalizeValue(mixed $value) Normalizes the value. | |
mixed | mergeValues(mixed $leftSide, mixed $rightSide) Merges two values together. | |
mixed | finalizeValue(mixed $value) Finalizes a value. | |
bool | allowPlaceholders() Tests if placeholder values are allowed for this node. | |
bool | isHandlingPlaceholder() Tests if a placeholder is being handled currently. | |
array | getValidPlaceholderTypes() Gets allowed dynamic types for this node. |
string|null | $name | |
NodeInterface | $parent | |
string | $pathSeparator |
InvalidArgumentException | if the name contains a period |
Register possible (dummy) values for a dynamic placeholder value.
Matching configuration values will be processed with a provided value, one by one. After a provided value is successfully processed the configuration value is returned as is, thus preserving the placeholder.
string | $placeholder | |
array | $values |
void |
Sets a common prefix for dynamic placeholder values.
Matching configuration values will be skipped from being processed and are returned as is, thus preserving the placeholder. An exact match provided by {see setPlaceholder()} might take precedence.
string | $prefix |
void |
Resets all current placeholders available.
void |
$key | ||
$value |
$key | ||
$default |
$key |
array | $attributes |
$key |
Sets an info message.
string | $info |
Returns info message.
string | The info text |
Sets the example configuration for this node.
string|array | $example |
Retrieves the example configuration for this node.
string|array | The example |
Adds an equivalent value.
mixed | $originalValue | |
mixed | $equivalentValue |
Set this node as required.
bool | $boolean | Required node |
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.
string|null | $message | Deprecated message |
Sets if this node can be overridden.
bool | $allow |
Sets the closures used for normalization.
array | $closures | An array of Closures used for normalization |
Sets the closures used for final validation.
array | $closures | An array of Closures used for final validation |
Returns true when the node is required.
bool | If the node is required |
Checks if this node is deprecated.
bool |
Returns the deprecated message.
string | $node | the configuration node name |
string | $path | the path of the node |
string |
Returns the name of the node.
string | The name of the node |
Returns the path of the node.
string | The node path |
Merges two values together.
mixed | $leftSide | |
mixed | $rightSide |
mixed | The merged value |
ForbiddenOverwriteException | if the configuration path cannot be overwritten |
InvalidTypeException | if the value type is invalid |
Normalizes a value.
mixed | $value | The value to normalize |
mixed | The normalized value |
InvalidTypeException | if the value type is invalid |
Normalizes the value before any other normalization is applied.
$value |
$value | The normalized array value |
Returns parent node for this node.
NodeInterface|null |
Finalizes a value.
mixed | $value | The value to finalize |
mixed | The finalized value |
InvalidTypeException | if the value type is invalid |
InvalidConfigurationException | if the value is invalid configuration |
Validates the type of a Node.
mixed | $value | The value to validate |
InvalidTypeException | when the value is invalid |
Normalizes the value.
mixed | $value | The value to normalize |
mixed | The normalized value |
Merges two values together.
mixed | $leftSide | |
mixed | $rightSide |
mixed | The merged value |
Finalizes a value.
mixed | $value | The value to finalize |
mixed | The finalized value |
Tests if placeholder values are allowed for this node.
bool |
Tests if a placeholder is being handled currently.
bool |
Gets allowed dynamic types for this node.
array |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Config/Definition/BaseNode.html