Skip to content

Commit 8cb8f17

Browse files
committed
adjust to final clients
1 parent f37f0d7 commit 8cb8f17

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

components/client-common.rst

Lines changed: 13 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,10 @@ their responses as a ``BatchResult``::
4852

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

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

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

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

128136
LeastUsedClientPool
129137
*******************
@@ -228,3 +236,7 @@ and also to download an image from a static host::
228236
it's easier to use the ``RequestConditionalPlugin`` and the ``PluginClient``,
229237
but in that case the routing logic is integrated into the linear request flow
230238
which might make debugging harder.
239+
240+
..versionadded:: 2.0
241+
``HttpClientRouter`` is final since version 2.0. You can typehint the
242+
``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)