File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -101,10 +101,38 @@ node definition. Node type are available for:
101
101
* boolean
102
102
* array
103
103
* enum (new in 2.1)
104
+ * integer (new in 2.2)
105
+ * float (new in 2.2)
104
106
* variable (no validation)
105
107
106
108
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
+ ;
108
136
109
137
Array nodes
110
138
~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments