Closed
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | yes |
Symfony version | 3.3.z |
I am having this class and want to autowire it:
use SimpleBus\Message\Bus\MessageBus;
class AddressController
{
/**
* AddressController constructor.
*
* @param MessageBus $commandBus Bla bla (e.g. simple_bus.command_bus)
*/
public function __construct(MessageBus $commandBus)
{
// ...
}
}
But it errors with:
argument "$commandBus" of method "__construct()" references interface "SimpleBus\Message\Bus\MessageBus" but no such service exists. You should maybe alias this interface to one of these existing services: "simple_bus.command_bus", "simple_bus.event_bus".
I understand this and like to add a feature request.
Put in some additional strategy to autowire services like:
- Variable name can be found in the service name (e.g.
$commandBus
in "simple_bus.command_bus"). - DocComment tells which service to use (e.g.
Bla bla (e.g. simple_bus.command_bus)
). - or
@see simple_bus.command_bus
I guess there is some more or better to look up.