Skip to content

Commit 1544a18

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: docs: Add the mime type in the example [IntegerType] fix rounding_mode default value Minor (language) improvements [Messenger] Removing note docblock for MessageHandlerInterface
2 parents 0d3401e + ab9dfa4 commit 1544a18

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

forms.rst

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -872,13 +872,13 @@ Form Type Guessing
872872
~~~~~~~~~~~~~~~~~~
873873

874874
If the object handled by the form includes validation constraints, Symfony can
875-
introspect that metadata to guess the type of your field and set it up for you.
876-
In the above example, Symfony can guess from the validation rules that both the
875+
introspect that metadata to guess the type of your field.
876+
In the above example, Symfony can guess from the validation rules that the
877877
``task`` field is a normal ``TextType`` field and the ``dueDate`` field is a
878878
``DateType`` field.
879879

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

883883
// src/Form/Type/TaskType.php
884884
namespace App\Form\Type;
@@ -913,23 +913,21 @@ pass ``null`` to it, to enable Symfony's "guessing mechanism"::
913913
Form Type Options Guessing
914914
..........................
915915

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

920919
``required``
921-
The ``required`` option can be guessed based on the validation rules (i.e. is
920+
The ``required`` option is guessed based on the validation rules (i.e. is
922921
the field ``NotBlank`` or ``NotNull``) or the Doctrine metadata (i.e. is the
923922
field ``nullable``). This is very useful, as your client-side validation will
924923
automatically match your validation rules.
925924

926925
``maxlength``
927926
If the field is some sort of text field, then the ``maxlength`` option attribute
928-
can be guessed from the validation constraints (if ``Length`` or ``Range`` is used)
927+
is guessed from the validation constraints (if ``Length`` or ``Range`` is used)
929928
or from the :doc:`Doctrine </doctrine>` metadata (via the field's length).
930929

931-
If you'd like to change one of the guessed values, override it by passing the
932-
option in the options field array::
930+
If you'd like to change one of the guessed values, override it in the options field array::
933931

934932
->add('task', null, ['attr' => ['maxlength' => 4]])
935933

mailer.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,9 @@ file or stream::
478478
$email = (new Email())
479479
// ...
480480
// get the image contents from a PHP resource
481-
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo')
481+
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo', 'image/png')
482482
// get the image contents from an existing file
483-
->embedFromPath('/path/to/images/signature.gif', 'footer-signature')
483+
->embedFromPath('/path/to/images/signature.gif', 'footer-signature', 'image/gif')
484484
;
485485

486486
The second optional argument of both methods is the image name ("Content-ID" in
@@ -489,8 +489,8 @@ images inside the HTML contents::
489489

490490
$email = (new Email())
491491
// ...
492-
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo')
493-
->embedFromPath('/path/to/images/signature.gif', 'footer-signature')
492+
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo', 'image/png')
493+
->embedFromPath('/path/to/images/signature.gif', 'footer-signature', 'image/gif')
494494

495495
// reference images using the syntax 'cid:' + "image embed name"
496496
->html('<img src="cid:logo"> ... <img src="cid:footer-signature"> ...')

messenger.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ message class (or a message interface)::
7070
}
7171
}
7272

73-
.. note::
74-
75-
You can also create a class without the attribute (e.g. if you're
76-
using PHP 7.4), by implementing :class:`Symfony\\Component\\Messenger\\Handler\\MessageHandlerInterface`
77-
instead.
78-
7973
.. tip::
8074

8175
You can also use the ``#[AsMessageHandler]`` attribute on individual class

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)