1
Ich habe ein Problem mit Abhängigkeiten Injektionen in Symfony3:Fehler bei der Lehre und kundenspezifische Service-Injektion
Das ist mein services.yml
some_service:
class: StagingBundle\Service\SomeService
arguments: ['@doctrine']
arguments: ['@test.other_service']
Dies ist der Konstruktor von SomeService.php ist
public function __construct($doctrine, SomeService $someService)
{
$this->doctrine=$doctrine;
$this->someService=$someService;
}
Beim Ausführen meines Konsolenbefehls erhalte ich den folgenden Fehler:
[Symfony\Component\Debug\Exception\ContextErrorException]
Catchable Fatal Error: Argument 2 passed to stagingBundle\Service\SomeService::__construct() must be an instance of StagingBundle\Service\OtherService, none given, called in /var/www/projects/myApp/var/cache/dev/appDevDebugProjectContainer.php on line 1141 and defined
Warum passiert das und wie kann ich es lösen?
Danke :) :) :) – Nathan