8000 feature #7834 Added a note about ignoring invalid reference arguments… · symfony/symfony-docs@412fe84 · GitHub
[go: up one dir, main page]

Skip to content

Commit 412fe84

Browse files
committed
feature #7834 Added a note about ignoring invalid reference arguments in collection arguments (javiereguiluz)
This PR was submitted for the 3.1 branch but it was merged into the 3.2 branch instead (closes #7834). Discussion ---------- Added a note about ignoring invalid reference arguments in collection arguments This fixes #6550. Commits ------- 0b2d9ba Added a note about ignoring invalid reference arguments in colleciton arguments
2 parents 89e5c4f + 0b2d9ba commit 412fe84

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

service_container/optional_dependencies.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ call if the service exists and remove the method call if it does not:
116116
))
117117
;
118118
119+
.. note::
120+
121+
If the argument to the method call is a collection of arguments and any of
122+
them is missing, those elements are removed but the method call is still
123+
made with the remaining elements of the collection.
124+
119125
In YAML, the special ``@?`` syntax tells the service container that the dependency
120126
is optional. Of course, the ``NewsletterManager`` must also be rewritten by
121127
adding a ``setMailer()`` method::

0 commit comments

Comments
 (0)
0