Skip to content

Commit 685a93a

Browse files
committed
minor #17780 [Clock][HttpKernel] [Controller] Mention the use of the Clock component in DateTimeValueResolver (alexandre-daubois)
This PR was merged into the 6.3 branch. Discussion ---------- [Clock][HttpKernel] [Controller] Mention the use of the Clock component in `DateTimeValueResolver` Resolves #17606 Commits ------- 3f8c53e [Controller] Mention the use of the Clock component in `DateTimeValueResolver`
2 parents 674f5a4 + 3f8c53e commit 685a93a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

controller/value_resolver.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,22 @@ Symfony ships with the following value resolvers in the
9494
You can restrict how the input can be formatted with the
9595
:class:`Symfony\\Component\\HttpKernel\\Attribute\\MapDateTime` attribute.
9696

97+
.. tip::
98+
99+
The ``DateTimeInterface`` object is generated with the :doc:`Clock component </components/clock>`,
100+
which means you can have full control over the date and time values the controller receives when
101+
testing your application. This can be achieved by using the
102+
:class:`Symfony\\Component\\Clock\\MockClock` implementation in your test environment.
103+
97104
.. versionadded:: 6.1
98105

99106
The ``DateTimeValueResolver`` was introduced in Symfony 6.1.
100107

108+
.. versionadded:: 6.3
109+
110+
The use of the :doc:`Clock component </components/clock>` to generate the
111+
``DateTimeInterface`` object was introduced in Symfony 6.3.
112+
101113
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestValueResolver`
102114
Injects the current ``Request`` if type-hinted with ``Request`` or a class
103115
extending ``Request``.

0 commit comments

Comments
 (0)