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