Closed tacman closed 5 years ago
Figured it out:
in services.yaml:
Voryx\ThruwayBundle\Client\ClientManager:
alias: thruway.client
The constructor:
use Voryx\ThruwayBundle\Client\ClientManager;
public function __construct(EntityManagerInterface $entityManager,
ClientManager $thruwayClient,..
Symfony 4 strongly discourages passing the container. I'm trying to autowire the client in a Symfony 4 command, but can't quite figure out how to do it. I've tried
Got an error about not being able to autowire,
so I added an alias in services.yaml:
But I think I'm passing in the Manager, not the Client, since there is no publish command. Is it possible to autowire the thruway services, to avoid using the container?