Skip to content

Commit 6526c09

Browse files
committed
adjust to final clients
1 parent f37f0d7 commit 6526c09

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

components/client-common.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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+
``HttpMethodsClient`` is final since version 2.0. You can typehint the
31+
``HttpMethodsClientInterface`` to allow mocking the client in unit tests.
32+
2933
BatchClient
3034
-----------
3135

@@ -48,6 +52,12 @@ their responses as a ``BatchResult``::
4852

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

55+
56+
..versionadded:: 2.0
57+
``BatchClient`` is final since version 2.0. You can typehint the
58+
``BatchClientInterface`` to allow mocking the client in unit tests.
59+
60+
5161
The ``BatchResult`` itself is an object that contains responses for all requests sent.
5262
It provides methods that give appropriate information based on a given request::
5363

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

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

128138
LeastUsedClientPool
129139
*******************
@@ -228,3 +238,7 @@ and also to download an image from a static host::
228238
it's easier to use the ``RequestConditionalPlugin`` and the ``PluginClient``,
229239
but in that case the routing logic is integrated into the linear request flow
230240
which might make debugging harder.
241+
242+
..versionadded:: 2.0
243+
``HttpClientRouter`` is final since version 2.0. You can typehint the
244+
``HttpClientRouterInterface`` to allow mocking the client in unit tests.

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)