Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions service_container/optional_dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ call if the service exists and remove the method call if it does not:
))
;

.. note::

If the argument to the method call is a collection of arguments and any of
them is missing, those elements are removed but the method call is still
made with the remaining elements of the collection.

In YAML, the special ``@?`` syntax tells the service container that the dependency
is optional. Of course, the ``NewsletterManager`` must also be rewritten by
adding a ``setMailer()`` method::
Expand Down