Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
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. | ||
| Numeric node constraints | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Member 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. This need a | ||
| .. 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 | ||
Member 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 ContributorAuthor 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 | ||
| ~~~~~~~~~~~ | ||