In the services.yaml file, I added guzzle client as a service:
guzzle:
class: GuzzleHttpClient
In the service class, I try to inject Guzzle:
/**
* @var GuzzleHttpClient $httpClient;
*/
protected $httpClient;
public function __construct(GuzzleHttpClient $httpClient)
{
$this->httpClient = $httpClient;
}
I get the following error:
Cannot autowire service "AppServiceMyService": argument "$httpClient" of method "__construct()" references class "GuzzleHttpClient" but no such service exists. You should maybe alias this class to the existing "guzzle" service.
What am I missing here?