diff --git a/controller/value_resolver.rst b/controller/value_resolver.rst index 6ceeee77084..578b2738d56 100644 --- a/controller/value_resolver.rst +++ b/controller/value_resolver.rst @@ -94,10 +94,22 @@ Symfony ships with the following value resolvers in the You can restrict how the input can be formatted with the :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapDateTime` attribute. + .. tip:: + + The ``DateTimeInterface`` object is generated with the :doc:`Clock component `, + which means you can have full control over the date and time values the controller receives when + testing your application. This can be achieved by using the + :class:`Symfony\\Component\\Clock\\MockClock` implementation in your test environment. + .. versionadded:: 6.1 The ``DateTimeValueResolver`` was introduced in Symfony 6.1. + .. versionadded:: 6.3 + + The use of the :doc:`Clock component ` to generate the + ``DateTimeInterface`` object was introduced in Symfony 6.3. + :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestValueResolver` Injects the current ``Request`` if type-hinted with ``Request`` or a class extending ``Request``.