mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-24 00:32:14 +01:00
Reword
This commit is contained in:
@@ -52,12 +52,11 @@ argument of type ``service_closure``:
|
||||
# In case the dependency is optional
|
||||
# arguments: [!service_closure '@?mailer']
|
||||
|
||||
.. versionadded:: 7.3
|
||||
# you can also use the special '@>' syntax as a shortcut of '!service_closure'
|
||||
App\Service\AnotherService:
|
||||
arguments: ['@>mailer']
|
||||
|
||||
# A shorthand is available
|
||||
# arguments: ['@>mailer']
|
||||
|
||||
# It also works when the dependency is optional
|
||||
# the shortcut also works for optional dependencies
|
||||
# arguments: ['@>?mailer']
|
||||
|
||||
.. code-block:: xml
|
||||
@@ -98,6 +97,10 @@ argument of type ``service_closure``:
|
||||
// ->args([service_closure('mailer')->ignoreOnInvalid()]);
|
||||
};
|
||||
|
||||
.. versionadded:: 7.3
|
||||
|
||||
The ``@>`` shortcut syntax for YAML was introduced in Symfony 7.3.
|
||||
|
||||
.. seealso::
|
||||
|
||||
Service closures can be injected :ref:`by using autowiring <autowiring_closures>`
|
||||
|
||||
Reference in New Issue
Block a user