EnumNode
class EnumNode extends ScalarNode
Node which only allows a finite set of values.
Constants
DEFAULT_PATH_SEPARATOR |
|
Properties
protected | $name | from BaseNode | |
protected | $parent | from BaseNode | |
protected | $normalizationClosures | from BaseNode | |
protected | $finalValidationClosures | from BaseNode | |
protected | $allowOverwrite | from BaseNode | |
protected | $required | from BaseNode | |
protected | $deprecationMessage | from BaseNode | |
protected | $equivalentValues | from BaseNode | |
protected | $attributes | from BaseNode | |
protected | $pathSeparator | from BaseNode | |
protected | $defaultValueSet | from VariableNode | |
protected | $defaultValue | from VariableNode | |
protected | $allowEmptyValue | from VariableNode |
Methods
No description
Register possible (dummy) values for a dynamic placeholder value.
Sets a common prefix for dynamic placeholder values.
Adds an equivalent value.
Sets the closures used for final validation.
Returns the deprecated message.
Normalizes the value before any other normalization is applied.
Finalizes a value.
Tests if placeholder values are allowed for this node.
Sets if this node is allowed to have an empty value.
Evaluates if the given value is to be treated as empty.
No description
Details
__construct(string|null $name, NodeInterface $parent = null, array $values = array(), string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR)
static void
setPlaceholder(string $placeholder, array $values)
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.
static void
setPlaceholderUniquePrefix(string $prefix)
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.
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.