php - Error when injecting doctrine and custom service -
i have problem dependencies injections in symfony3:
this services.yml
some_service: class: stagingbundle\service\someservice arguments: ['@doctrine'] arguments: ['@test.other_service']
this constructor of someservice.php
public function __construct($doctrine, someservice $someservice) { $this->doctrine=$doctrine; $this->someservice=$someservice; }
when running console command following error:
[symfony\component\debug\exception\contexterrorexception] catchable fatal error: argument 2 passed stagingbundle\service\someservice::__construct() must instance of stagingbundle\service\otherservice, none given, called in /var/www/projects/myapp/var/cache/dev/appdevdebugprojectcontainer.php on line 1141 , defined
why happen , how can solve it?
"arguments" array , can there once, should this
some_service: class: stagingbundle\service\someservice arguments: ['@doctrine', '@test.other_service']
Comments
Post a Comment