Skip to content

Commit 68545a2

Browse files
committed
minor #13322 [DI] Use improved Yaml syntax for defining method calls (W0rma)
This PR was merged into the 4.4 branch. Discussion ---------- [DI] Use improved Yaml syntax for defining method calls Examples were desribed in the blog: https://symfony.com/blog/new-in-symfony-4-4-dependency-injection-improvements-part-2#improved-yaml-syntax-for-method-calls Fixes #12443 Commits ------- 5f8e782 use improved Yaml syntax for defining method calls
2 parents 07da6ce + 5f8e782 commit 68545a2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

service_container/calls.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ To configure the container to call the ``setLogger`` method, use the ``calls`` k
4040
App\Service\MessageGenerator:
4141
# ...
4242
calls:
43-
- method: setLogger
44-
arguments:
45-
- '@logger'
43+
- setLogger: ['@logger']
4644
4745
.. code-block:: xml
4846
@@ -121,10 +119,7 @@ The configuration to tell the container it should do so would be like:
121119
App\Service\MessageGenerator:
122120
# ...
123121
calls:
124-
- method: withLogger
125-
arguments:
126-
- '@logger'
127-
returns_clone: true
122+
- withLogger: !returns_clone ['@logger']
128123
129124
.. code-block:: xml
130125

0 commit comments

Comments
 (0)