From 2551bf7fa460ec6ba1c1e9f69474a608c610f115 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Thu, 16 Mar 2023 10:02:17 +0100 Subject: [PATCH] Replace interface use HttpClient by HttpAsyncClient --- http_client.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/http_client.rst b/http_client.rst index 38d63e47ed4..193b39bd5f7 100644 --- a/http_client.rst +++ b/http_client.rst @@ -1576,14 +1576,14 @@ interoperable with libraries that require it thanks to the Let's say you want to instantiate a class with the following constructor, that requires HTTPlug dependencies:: - use Http\Client\HttpClient; + use Http\Client\HttpAsyncClient; use Http\Message\RequestFactory; use Http\Message\StreamFactory; class SomeSdk { public function __construct( - HttpClient $httpClient, + HttpAsyncClient $httpClient, RequestFactory $requestFactory, StreamFactory $streamFactory ) @@ -1597,8 +1597,7 @@ Because ``HttplugClient`` implements the three interfaces, you can use it this w $httpClient = new HttplugClient(); $apiClient = new SomeSdk($httpClient, $httpClient, $httpClient); -If you'd like to work with promises, ``HttplugClient`` also implements the -``HttpAsyncClient`` interface. To use it, you need to install the +To use it, you need to install the ``guzzlehttp/promises`` package: .. code-block:: terminal