Skip to content

Commit 250c35b

Browse files
committed
Reword
1 parent 092e1f1 commit 250c35b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

service_container/service_closures.rst

+8-5
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ argument of type ``service_closure``:
5252
# In case the dependency is optional
5353
# arguments: [!service_closure '@?mailer']
5454
55-
.. versionadded:: 7.3
56-
57-
# A shorthand is available
58-
# arguments: ['@>mailer']
55+
# you can also use the special '@>' syntax as a shortcut of '!service_closure'
56+
App\Service\AnotherService:
57+
arguments: ['@>mailer']
5958
60-
# It also works when the dependency is optional
59+
# the shortcut also works for optional dependencies
6160
# arguments: ['@>?mailer']
6261
6362
.. code-block:: xml
@@ -98,6 +97,10 @@ argument of type ``service_closure``:
9897
// ->args([service_closure('mailer')->ignoreOnInvalid()]);
9998
};
10099
100+
.. versionadded:: 7.3
101+
102+
The ``@>`` shortcut syntax for YAML was introduced in Symfony 7.3.
103+
101104
.. seealso::
102105

103106
Service closures can be injected :ref:`by using autowiring <autowiring_closures>`

0 commit comments

Comments
 (0)