We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6aad11c commit 430f932Copy full SHA for 430f932
service_container/optional_dependencies.rst
@@ -120,10 +120,10 @@ call if the service exists and remove the method call if it does not:
120
));
121
122
In YAML, the special ``@?`` syntax tells the service container that the dependency
123
-is optional. Of course, the ``NewsletterManager`` must also be rewritten to
124
-allow for an optional dependency::
+is optional. Of course, the ``NewsletterManager`` must also be rewritten by
+adding a ``setMailer()`` method::
125
126
- public function __construct(Mailer $mailer = null)
+ public function setMailer(Mailer $mailer)
127
{
128
// ...
129
}
0 commit comments