Skip to content

Commit b4dddfd

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [IntegerType] fix rounding_mode default value Minor (language) improvements
2 parents 03ecb46 + e5dbbdc commit b4dddfd

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

forms.rst

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -862,13 +862,13 @@ Form Type Guessing
862862
~~~~~~~~~~~~~~~~~~
863863

864864
If the object handled by the form includes validation constraints, Symfony can
865-
introspect that metadata to guess the type of your field and set it up for you.
866-
In the above example, Symfony can guess from the validation rules that both the
865+
introspect that metadata to guess the type of your field.
866+
In the above example, Symfony can guess from the validation rules that the
867867
``task`` field is a normal ``TextType`` field and the ``dueDate`` field is a
868868
``DateType`` field.
869869

870-
When building the form, omit the second argument to the ``add()`` method, or
871-
pass ``null`` to it, to enable Symfony's "guessing mechanism"::
870+
To enable Symfony's "guessing mechanism", omit the second argument to the ``add()`` method, or
871+
pass ``null`` to it::
872872

873873
// src/Form/Type/TaskType.php
874874
namespace App\Form\Type;
@@ -903,23 +903,21 @@ pass ``null`` to it, to enable Symfony's "guessing mechanism"::
903903
Form Type Options Guessing
904904
..........................
905905

906-
When the guessing mechanism is enabled for some field (i.e. you omit or pass
907-
``null`` as the second argument to ``add()``), in addition to its form type,
908-
the following options can be guessed too:
906+
When the guessing mechanism is enabled for some field, in addition to its form type,
907+
the following options will be guessed too:
909908

910909
``required``
911-
The ``required`` option can be guessed based on the validation rules (i.e. is
910+
The ``required`` option is guessed based on the validation rules (i.e. is
912911
the field ``NotBlank`` or ``NotNull``) or the Doctrine metadata (i.e. is the
913912
field ``nullable``). This is very useful, as your client-side validation will
914913
automatically match your validation rules.
915914

916915
``maxlength``
917916
If the field is some sort of text field, then the ``maxlength`` option attribute
918-
can be guessed from the validation constraints (if ``Length`` or ``Range`` is used)
917+
is guessed from the validation constraints (if ``Length`` or ``Range`` is used)
919918
or from the :doc:`Doctrine </doctrine>` metadata (via the field's length).
920919

921-
If you'd like to change one of the guessed values, override it by passing the
922-
option in the options field array::
920+
If you'd like to change one of the guessed values, override it in the options field array::
923921

924922
->add('task', null, ['attr' => ['maxlength' => 4]])
925923

reference/forms/types/integer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Field Options
3535
``rounding_mode``
3636
~~~~~~~~~~~~~~~~~
3737

38-
**type**: ``integer`` **default**: ``\NumberFormatter::ROUND_HALFUP``
38+
**type**: ``integer`` **default**: ``\NumberFormatter::ROUND_DOWN``
3939

4040
By default, if the user enters a non-integer number, it will be rounded
4141
down. You have several configurable options for that rounding. Each option

0 commit comments

Comments
 (0)