Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletioncomponents/config/definition.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Member

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

.. 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
Copy link
Member

Choose a reason for hiding this comment

The 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: with:: (at the end of the sentence)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The 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
~~~~~~~~~~~
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp