Skip to content

Commit 0b2d9ba

Browse files
javiereguiluzxabbuh
authored andcommitted
Added a note about ignoring invalid reference arguments in colleciton arguments
1 parent 89e5c4f commit 0b2d9ba

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)