Skip to content

Commit 32e7bfc

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Show example on using a DateTimeImmutable object Describe actual traversal behaviour
2 parents 17055f0 + e68678a commit 32e7bfc

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

reference/constraints/Valid.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,6 @@ traverse
264264

265265
**type**: ``boolean`` **default**: ``true``
266266

267-
If this constraint is applied to a property that holds an array of objects,
268-
then each object in that array will be validated only if this option is
269-
set to ``true``.
267+
If this constraint is applied to a ``Traversable``, then all containing values
268+
will be validated if this option is set to ``true``. This option is ignored on
269+
arrays: Arrays are traversed in either case. Keys are not validated.

reference/forms/types/date.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,13 @@ field as **three different choice fields**::
6666
'widget' => 'choice',
6767
]);
6868

69-
If your underlying date is *not* a ``DateTime`` object (e.g. it's a unix timestamp),
70-
configure the `input`_ option.
69+
If your underlying date is *not* a ``DateTime`` object (e.g. it's a unix
70+
timestamp or a ``DateTimeImmutable`` object), configure the `input`_ option::
71+
72+
$builder->add('publishedAt', DateType::class, [
73+
'widget' => 'choice',
74+
'input' => 'datetime_immutable'
75+
]);
7176

7277
Rendering a single HTML5 Textbox
7378
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)