@@ -84,15 +84,15 @@ Usage
8484
8585 .. code-block :: php
8686
87- $request = $this->container->get('httplug.message_factory ')->createRequest('GET', 'http://example.com/');
87+ $request = $this->container->get('httplug.psr17_request_factory ')->createRequest('GET', 'http://example.com/');
8888 $response = $this->container->get('httplug.client.acme')->sendRequest($request);
8989
9090 Autowiring
9191``````````
9292
9393The first configured client is considered the "default" client. The default
9494clients are available for `autowiring `_: The PSR-18 ``Psr\Http\Client\ClientInterface ``
95- (or the deprecated `` Http\Client\HttpClient ``) and the ``Http\Client\HttpAsyncClient ``.
95+ and the ``Http\Client\HttpAsyncClient ``.
9696Autowiring can be convenient to build your application.
9797
9898However, if you configured several different clients and need to be sure that
@@ -110,12 +110,13 @@ When using this bundle with Symfony 5.3 or newer, you can use the Symfony
110110
111111.. code-block :: php
112112
113+ use Psr\Http\Client\ClientInterface;
113114 use Symfony\Component\DependencyInjection\Attribute as DI;
114115
115116 final class MyService
116117 {
117118 public function __construct(
118- #[DI\Target('acme')] HttpClient $client
119+ #[DI\Target('acme')] ClientInterface $client
119120 ) {}
120121 }
121122
@@ -175,8 +176,8 @@ also disable the profiling by configuration.
175176 You can configure the bundle to show debug information for clients found with
176177discovery. You may also force a specific client to be found when a third party
177178library is using discovery. The configuration below makes sure the client with
178- service id ``httplug.client.my_guzzle5 `` is returned when calling
179- ``HttpClientDiscovery ::find() `` . It does also make sure to show debug info for
179+ service id ``httplug.client.my_guzzle7 `` is returned when calling
180+ ``Psr18ClientDiscovery ::find() `` . It does also make sure to show debug info for
180181asynchronous clients.
181182
182183.. note ::
@@ -187,10 +188,10 @@ asynchronous clients.
187188
188189 httplug :
189190 clients :
190- my_guzzle5 :
191- factory : ' httplug.factory.guzzle5 '
191+ my_guzzle7 :
192+ factory : ' httplug.factory.guzzle7 '
192193 discovery :
193- client : ' httplug.client.my_guzzle5 '
194+ client : ' httplug.client.my_guzzle7 '
194195 async_client : ' auto'
195196
196197 For normal clients, the auto discovery debug info is enabled by default. For
@@ -211,10 +212,11 @@ example shows how you configure factory classes using Guzzle:
211212
212213 httplug :
213214 classes :
214- client : Http\Adapter\Guzzle6\Client
215- message_factory : Http\Message\MessageFactory\GuzzleMessageFactory
216- uri_factory : Http\Message\UriFactory\GuzzleUriFactory
217- stream_factory : Http\Message\StreamFactory\GuzzleStreamFactory
215+ client : Http\Adapter\Guzzle7\Client
216+ psr17_request_factory : GuzzleHttp\Psr7\HttpFactory
217+ psr17_response_factory : GuzzleHttp\Psr7\HttpFactory
218+ psr17_uri_factory : GuzzleHttp\Psr7\HttpFactory
219+ psr17_stream_factory : GuzzleHttp\Psr7\HttpFactory
218220
219221 Configure Clients
220222`````````````````
@@ -227,8 +229,8 @@ services.
227229
228230 httplug :
229231 clients :
230- my_guzzle5 :
231- factory : ' httplug.factory.guzzle5 '
232+ my_guzzle7 :
233+ factory : ' httplug.factory.guzzle7 '
232234 config :
233235 # These options are given to Guzzle without validation.
234236 defaults :
@@ -244,10 +246,10 @@ services.
244246
245247 .. code-block :: php
246248
247- $httpClient = $this->container->get('httplug.client.my_guzzle5 ');
249+ $httpClient = $this->container->get('httplug.client.my_guzzle7 ');
248250 $httpClient = $this->container->get('httplug.client.acme');
249251
250- // will be the same as ``httplug.client.my_guzzle5 ``
252+ // will be the same as ``httplug.client.my_guzzle7 ``
251253 $httpClient = $this->container->get('httplug.client');
252254
253255 The bundle has client factory services that you can use to build your client.
@@ -257,11 +259,11 @@ services are:
257259
258260* ``httplug.factory.curl ``
259261* ``httplug.factory.buzz ``
260- * ``httplug.factory.guzzle5 ``
261262* ``httplug.factory.guzzle6 ``
262263* ``httplug.factory.guzzle7 ``
263264* ``httplug.factory.react ``
264265* ``httplug.factory.socket ``
266+ * ``httplug.factory.symfony ``
265267* ``httplug.factory.mock `` (Install ``php-http/mock-client `` first)
266268
267269.. note ::
@@ -479,11 +481,13 @@ List of Services
479481+-------------------------------------+-------------------------------------------------------------------------+
480482| Service id | Description |
481483+=====================================+=========================================================================+
482- | ``httplug.message_factory `` | Service* that provides the `Http\Message\MessageFactory ` |
484+ | ``httplug.psr17_request_factory `` | Service* that provides the `Psr\ Http\Message\RequestFactoryInterface ` |
483485+-------------------------------------+-------------------------------------------------------------------------+
484- | ``httplug.uri_factory `` | Service* that provides the `Http\Message\UriFactory ` |
486+ | ``httplug.psr17_response_factory `` | Service* that provides the `Psr\ Http\Message\ResponseFactoryInterface ` |
485487+-------------------------------------+-------------------------------------------------------------------------+
486- | ``httplug.stream_factory `` | Service* that provides the `Http\Message\StreamFactory ` |
488+ | ``httplug.psr17_uri_factory `` | Service* that provides the `Psr\Http\Message\UriFactoryInterface ` |
489+ +-------------------------------------+-------------------------------------------------------------------------+
490+ | ``httplug.psr17_stream_factory `` | Service* that provides the `Psr\Http\Message\StreamFactoryInterface ` |
487491+-------------------------------------+-------------------------------------------------------------------------+
488492| ``httplug.client.[name] `` | There is one service per named client. |
489493+-------------------------------------+-------------------------------------------------------------------------+
0 commit comments