Skip to content

Commit 357dc35

Browse files
committed
Merge remote-tracking branch 'origin/master' into new_master
Conflicts: components/config/definition.rst
2 parents 4906065 + 730a31b commit 357dc35

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

components/config/definition.rst

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,38 @@ node definition. Node type are available for:
101101
* boolean
102102
* array
103103
* enum (new in 2.1)
104+
* integer (new in 2.2)
105+
* float (new in 2.2)
104106
* variable (no validation)
105107

106108
and are created with ``node($name, $type)`` or their associated shortcut
107-
``xxxxNode($name)`` method.
109+
``xxxxNode($name)`` method.
110+
111+
Numeric node constraints
112+
~~~~~~~~~~~~~~~~~~~~~~~~
113+
114+
.. versionadded:: 2.2
115+
116+
The numeric (float and integer) nodes are new in 2.2
117+
118+
Numeric node (float and integer) provide two extra constraints min() and
119+
max() allowing to validate the value:
120+
121+
.. code-block:: php
122+
123+
$rootNode
124+
->children()
125+
->integerNode('positive_value')
126+
->min(0)
127+
->end()
128+
->floatNode('big_value')
129+
->max(5E45)
130+
->end()
131+
->integerNode('value_inside_a_range')
132+
->min(-50)->max(50)
133+
->end()
134+
->end()
135+
;
108136
109137
Array nodes
110138
~~~~~~~~~~~

0 commit comments

Comments
 (0)