I'm starting a new project using Symfony 3.3. I'm would like to use the new autoconfigure/autowiring features but I'm running into an "issue" I'm not sure how to solve.
I have the following services definition coming from an external bundle:
command_bus:
class: Name\Space\To\MessageBusSupportingMiddleware
...
event_bus:
class: Name\Space\To\MessageBusSupportingMiddleware
...
Both services are based on the same "MessageBusSupportingMiddleware" class but their intention is totally different of course.
Now I want Symfony 3.3 to automatically inject the "command_bus" service into my controller. But for this, I would have to use the class in the constructor like this:
public function __construct(
MessageBusSupportingMiddleware $commandBus
){
$this->commandBus = $commandBus;
}
In this case though, Symfony complains because it actually finds several service definition related to this class and so it cannot know which one to provide.
How do you think I could handle this situation ?