-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Config] Documentation of the new numerical type handling #1732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,10 +100,39 @@ node definition. Node type are available for: | |
* scalar | ||
* boolean | ||
* array | ||
* enum (new in 2.1) | ||
* integer (new in 2.2) | ||
* float (new in 2.2) | ||
* variable (no validation) | ||
|
||
and are created with ``node($name, $type)`` or their associated shortcut | ||
``xxxxNode($name)`` method. | ||
``xxxxNode($name)`` method. | ||
|
||
Numeric node constraints | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. versionadded:: 2.2 | ||
|
||
The numeric (float and integer) nodes are new in 2.2 | ||
|
||
Numeric node (float and integer) provide two extra constraints min() and | ||
max() allowing to validate the value: | ||
|
||
.. code-block:: php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should to remove this line (ad the one before this) and replace the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wouterj What is the logic about using code-block or using the :: notation? |
||
|
||
$rootNode | ||
->children() | ||
->integerNode('positive_value') | ||
->min(0) | ||
->end() | ||
->floatNode('big_value') | ||
->max(5E45) | ||
->end() | ||
->integerNode('value_inside_a_range') | ||
->min(-50)->max(50) | ||
->end() | ||
->end() | ||
; | ||
|
||
Array nodes | ||
~~~~~~~~~~~ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This need a
.. versionadded:: 2.2
note