Skip to content

Commit deecbcd

Browse files
committed
adjust to final clients
1 parent f37f0d7 commit deecbcd

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

components/client-common.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To be able to do that, it also wraps a message factory::
1717
use Http\Discovery\HttpClientDiscovery;
1818
use Http\Discovery\MessageFactoryDiscovery;
1919

20-
$client = new HttpMethodsClient(
20+
$client = new HttpMethodsClientImpl(
2121
HttpClientDiscovery::find(),
2222
MessageFactoryDiscovery::find()
2323
);
@@ -26,6 +26,10 @@ To be able to do that, it also wraps a message factory::
2626
$bar = $client->get('http://example.com/bar', ['accept-encoding' => 'application/json']);
2727
$post = $client->post('http://example.com/update', [], 'My post body');
2828

29+
..versionadded:: 2.0
30+
In version 2.0, HttpMethodsClient is the interface, implemented by HttpMethodsClientImpl.
31+
In version 1, the implementation was called HttpMethodsClient and there was no interface.
32+
2933
BatchClient
3034
-----------
3135

@@ -42,12 +46,17 @@ their responses as a ``BatchResult``::
4246
$messageFactory->createRequest('POST', 'http://example.com/update', [], 'My post body'),
4347
];
4448

45-
$client = new BatchClient(
49+
$client = new BatchClientImpl(
4650
HttpClientDiscovery::find()
4751
);
4852

4953
$batchResult = $client->sendRequests($requests);
5054

55+
56+
..versionadded:: 2.0
57+
In version 2.0, BatchClient is the interface, implemented by BatchClientImpl.
58+
In version 1, the implementation was called BatchClient and there was no interface.
59+
5160
The ``BatchResult`` itself is an object that contains responses for all requests sent.
5261
It provides methods that give appropriate information based on a given request::
5362

@@ -123,7 +132,7 @@ To enable the behavior, wrap the clients with the ``HttpClientPoolItem`` class y
123132
// Never reactivate the client (default)
124133
$httpClientPool->addHttpClient(new HttpClientPoolItem($httpClient, null));
125134

126-
``HttpClientPool`` is abstract. There are three concrete implementations with specific strategies on how to choose clients:
135+
``HttpClientPool`` is an interface. There are three concrete implementations with specific strategies on how to choose clients:
127136

128137
LeastUsedClientPool
129138
*******************
@@ -175,7 +184,7 @@ and also to download an image from a static host::
175184
use Http\Message\Authentication\BasicAuth;
176185
use Http\Message\RequestMatcher\RequestMatcher;
177186

178-
$client = new HttpClientRouter();
187+
$client = new HttpClientRouterImpl();
179188

180189
$requestMatcher = new RequestMatcher(null, 'api.example.com');
181190
$pluginClient = new PluginClient(
@@ -228,3 +237,7 @@ and also to download an image from a static host::
228237
it's easier to use the ``RequestConditionalPlugin`` and the ``PluginClient``,
229238
but in that case the routing logic is integrated into the linear request flow
230239
which might make debugging harder.
240+
241+
..versionadded:: 2.0
242+
In version 2.0, HttpClientRouter is the interface, implemented by HttpClientRouterImpl.
243+
In version 1, the implementation was called HttpMethodsClient and there was no interface.

integrations/symfony-bundle.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Plugins
225225
```````
226226

227227
Clients can have plugins that act on the request before it is sent out and/or
228-
on the response before it is returned to the caller. Generic plugins from
228+
on the response before it is returned to the caller. Generic plugins from
229229
``php-http/client-common`` (e.g. retry or redirect) can be configured globally.
230230
You can tell the client which of those plugins to use, as well as specify the
231231
service names of custom plugins that you want to use.
@@ -322,7 +322,7 @@ Special HTTP Clients
322322
````````````````````
323323

324324
If you want to use the ``FlexibleHttpClient`` or ``HttpMethodsClient`` from the
325-
``php-http/message`` package you may specify that on the client configuration.
325+
``php-http/client-common`` package, you may specify that on the client configuration.
326326

327327
.. code-block:: yaml
328328

0 commit comments

Comments
 (0)