Skip to content

Commit

Permalink
Reword
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jan 10, 2025
1 parent 092e1f1 commit 250c35b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions service_container/service_closures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ argument of type ``service_closure``:
# In case the dependency is optional
# arguments: [!service_closure '@?mailer']
.. versionadded:: 7.3

# A shorthand is available
# arguments: ['@>mailer']
# you can also use the special '@>' syntax as a shortcut of '!service_closure'
App\Service\AnotherService:
arguments: ['@>mailer']
# It also works when the dependency is optional
# the shortcut also works for optional dependencies
# arguments: ['@>?mailer']
.. code-block:: xml
Expand Down Expand Up @@ -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>`
Expand Down

0 comments on commit 250c35b

Please sign in to comment.