10000 Added a note about ignoring invalid reference arguments in collection arguments by javiereguiluz · Pull Request #7834 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Added a note about ignoring invalid reference arguments in collection arguments #7834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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
8000
Diff view
Added a note about ignoring invalid reference arguments in colleciton…
… arguments
  • Loading branch information
javiereguiluz committed Apr 24, 2017
commit df13b3021fe36752bd40bbd773fa00ca037e1a26
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
0