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 @@ -74,7 +74,7 @@ Variable nodes
74
74
75
75
A tree contains node definitions which can be laid out in a semantic way.
76
76
This means, using indentation and the fluent notation, it is possible to
77
- reflect the real structure of the configuration values::
77
+ reflect the real structure of the configuration values:
78
78
79
79
$rootNode
80
80
->children()
@@ -100,11 +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
109
``xxxxNode($name) `` method.
107
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 max() allowing to validate the value:
119
+
120
+ .. code-block :: php
121
+
122
+ $rootNode
123
+ ->children()
124
+ ->integerNode('positive_value')
125
+ ->min(0)
126
+ ->end()
127
+ ->floatNode('big_value')
128
+ ->max(5E45)
129
+ ->end()
130
+ ->integerNode('value_inside_a_range')
131
+ ->min(-50)->max(50)
132
+ ->end()
133
+ ->end()
134
+ ;
135
+
108
136
Array nodes
109
137
~~~~~~~~~~~
110
138
You can’t perform that action at this time.
0 commit comments