class FloatNodeDefinition extends NumericNodeDefinition

This class provides a fluent interface for defining a float node.

Properties

protected $name from NodeDefinition
protected $normalization from NodeDefinition
protected $validation from NodeDefinition
protected $defaultValue from NodeDefinition
protected $default from NodeDefinition
protected $required from NodeDefinition
protected $deprecationMessage from NodeDefinition
protected $merge from NodeDefinition
protected $allowEmptyValue from NodeDefinition
protected $nullEquivalent from NodeDefinition
protected $trueEquivalent from NodeDefinition
protected $falseEquivalent from NodeDefinition
protected $pathSeparator from NodeDefinition
protected $parent from NodeDefinition
protected $attributes from NodeDefinition
protected $min from NumericNodeDefinition
protected $max from NumericNodeDefinition

Methods

__construct(string|null $name, NodeParentInterface $parent = null)

No description

$this
setParent(NodeParentInterface $parent)

Sets the parent node.

$this
info(string $info)

Sets info message.

$this
example(string|array $example)

Sets example configuration.

$this
attribute(string $key, mixed $value)

Sets an attribute on the node.

getNode(bool $forceRootNode = false)

Creates the node.

$this
defaultValue(mixed $value)

Sets the default value.

$this
isRequired()

Sets the node as required.

$this
setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.')

Sets the node as deprecated.

$this
treatNullLike(mixed $value)

Sets the equivalent value used when the node contains null.

$this
treatTrueLike(mixed $value)

Sets the equivalent value used when the node contains true.

$this
treatFalseLike(mixed $value)

Sets the equivalent value used when the node contains false.

$this
defaultNull()

Sets null as the default value.

$this
defaultTrue()

Sets true as the default value.

$this
defaultFalse()

Sets false as the default value.

beforeNormalization()

Sets an expression to run before the normalization.

$this
cannotBeEmpty()

Denies the node value being empty.

validate()

Sets an expression to run for the validation.

$this
cannotBeOverwritten(bool $deny = true)

Sets whether the node can be overwritten.

validation()

Gets the builder for validation rules.

merge()

Gets the builder for merging rules.

normalization()

Gets the builder for normalization rules.

createNode()

Instantiate and configure the node according to this definition.

$this
setPathSeparator(string $separator)

Set PathSeparator to use.

instantiateNode()

Instantiates a Node.

$this
max(mixed $max)

Ensures that the value is smaller than the given reference.

$this
min(mixed $min)

Ensures that the value is bigger than the given reference.

Details

in NodeDefinition at line 41
__construct(string|null $name, NodeParentInterface $parent = null)

Parameters

string|null $name
NodeParentInterface $parent

in NodeDefinition at line 52
$this setParent(NodeParentInterface $parent)

Sets the parent node.

Parameters

NodeParentInterface $parent

Return Value

$this

in NodeDefinition at line 66
$this info(string $info)

Sets info message.

Parameters

string $info The info text

Return Value

$this

in NodeDefinition at line 78
$this example(string|array $example)

Sets example configuration.

Parameters

string|array $example

Return Value

$this

in NodeDefinition at line 91
$this attribute(string $key, mixed $value)

Sets an attribute on the node.

Parameters

string $key
mixed $value

Return Value

$this

in NodeDefinition at line 115
NodeInterface getNode(bool $forceRootNode = false)

Creates the node.

Parameters

bool $forceRootNode Whether to force this node as the root node

Return Value

NodeInterface

in NodeDefinition at line 142
$this defaultValue(mixed $value)

Sets the default value.

Parameters

mixed $value The default value

Return Value

$this

in NodeDefinition at line 155
$this isRequired()

Sets the node as required.

Return Value

$this

in NodeDefinition at line 172
$this setDeprecated(string $message = 'The child node "%node%" at path "%path%" is deprecated.')

Sets the 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 $message Deprecation message

Return Value

$this

in NodeDefinition at line 186
$this treatNullLike(mixed $value)

Sets the equivalent value used when the node contains null.

Parameters

mixed $value

Return Value

$this

in NodeDefinition at line 200
$this treatTrueLike(mixed $value)

Sets the equivalent value used when the node contains true.

Parameters

mixed $value

Return Value

$this

in NodeDefinition at line 214
$this treatFalseLike(mixed $value)

Sets the equivalent value used when the node contains false.

Parameters

mixed $value

Return Value

$this

in NodeDefinition at line 226
$this defaultNull()

Sets null as the default value.

Return Value

$this

in NodeDefinition at line 236
$this defaultTrue()

Sets true as the default value.

Return Value

$this

in NodeDefinition at line 246
$this defaultFalse()

Sets false as the default value.

Return Value

$this

in NodeDefinition at line 256
ExprBuilder beforeNormalization()

Sets an expression to run before the normalization.

Return Value

ExprBuilder

in NumericNodeDefinition at line 69
$this cannotBeEmpty()

Denies the node value being empty.

Return Value

$this

in NodeDefinition at line 282
ExprBuilder validate()

Sets an expression to run for the validation.

The expression receives the value of the node and must return it. It can modify it. An exception should be thrown when the node is not valid.

Return Value

ExprBuilder

in NodeDefinition at line 294
$this cannotBeOverwritten(bool $deny = true)

Sets whether the node can be overwritten.

Parameters

bool $deny Whether the overwriting is forbidden or not

Return Value

$this

in NodeDefinition at line 306
protected ValidationBuilder validation()

Gets the builder for validation rules.

Return Value

ValidationBuilder

in NodeDefinition at line 320
protected MergeBuilder merge()

Gets the builder for merging rules.

Return Value

MergeBuilder

in NodeDefinition at line 334
protected NormalizationBuilder normalization()

Gets the builder for normalization rules.

Return Value

NormalizationBuilder

protected NodeInterface createNode()

Instantiate and configure the node according to this definition.

Return Value

NodeInterface The node instance

Exceptions

InvalidDefinitionException When the definition is invalid

in NodeDefinition at line 359
$this setPathSeparator(string $separator)

Set PathSeparator to use.

Parameters

string $separator

Return Value

$this

at line 28
protected VariableNode instantiateNode()

Instantiates a Node.

Return Value

VariableNode The node

in NumericNodeDefinition at line 35
$this max(mixed $max)

Ensures that the value is smaller than the given reference.

Parameters

mixed $max

Return Value

$this

Exceptions

InvalidArgumentException when the constraint is inconsistent

in NumericNodeDefinition at line 54
$this min(mixed $min)

Ensures that the value is bigger than the given reference.

Parameters

mixed $min

Return Value

$this

Exceptions

InvalidArgumentException when the constraint is inconsistent