Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1209e8d

Browse files
committed
Fixed parameter type mismatch in addMethodCall example.
1 parent 1e63001 commit 1209e8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/dependency_injection/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ If you do want to though then the container can call the setter method::
147147

148148
$container
149149
->register('newsletter_manager', 'NewsletterManager')
150-
->addMethodCall('setMailer', new Reference('mailer'));
150+
->addMethodCall('setMailer', array(new Reference('mailer')));
151151

152152
You could then get your ``newsletter_manager`` service from the container
153153
like this::
@@ -259,6 +259,6 @@ The ``newsletter_manager`` and ``mailer`` services can be set up using config fi
259259
260260
$container
261261
->register('newsletter_manager', 'NewsletterManager')
262-
->addMethodCall('setMailer', new Reference('mailer'));
262+
->addMethodCall('setMailer', array(new Reference('mailer')));
263263
264264
.. _Packagist: https://packagist.org/packages/symfony/dependency-injection

0 commit comments

Comments
 (0)