@@ -17,7 +17,7 @@ To be able to do that, it also wraps a message factory::
17
17
use Http\Discovery\HttpClientDiscovery;
18
18
use Http\Discovery\MessageFactoryDiscovery;
19
19
20
- $client = new HttpMethodsClient (
20
+ $client = new HttpMethodsClientImpl (
21
21
HttpClientDiscovery::find(),
22
22
MessageFactoryDiscovery::find()
23
23
);
@@ -26,6 +26,10 @@ To be able to do that, it also wraps a message factory::
26
26
$bar = $client->get('http://example.com/bar', ['accept-encoding' => 'application/json']);
27
27
$post = $client->post('http://example.com/update', [], 'My post body');
28
28
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
+
29
33
BatchClient
30
34
-----------
31
35
@@ -42,12 +46,17 @@ their responses as a ``BatchResult``::
42
46
$messageFactory->createRequest('POST', 'http://example.com/update', [], 'My post body'),
43
47
];
44
48
45
- $client = new BatchClient (
49
+ $client = new BatchClientImpl (
46
50
HttpClientDiscovery::find()
47
51
);
48
52
49
53
$batchResult = $client->sendRequests($requests);
50
54
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
+
51
60
The ``BatchResult `` itself is an object that contains responses for all requests sent.
52
61
It provides methods that give appropriate information based on a given request::
53
62
@@ -123,7 +132,7 @@ To enable the behavior, wrap the clients with the ``HttpClientPoolItem`` class y
123
132
// Never reactivate the client (default)
124
133
$httpClientPool->addHttpClient(new HttpClientPoolItem($httpClient, null));
125
134
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:
127
136
128
137
LeastUsedClientPool
129
138
*******************
@@ -175,7 +184,7 @@ and also to download an image from a static host::
175
184
use Http\Message\Authentication\BasicAuth;
176
185
use Http\Message\RequestMatcher\RequestMatcher;
177
186
178
- $client = new HttpClientRouter ();
187
+ $client = new HttpClientRouterImpl ();
179
188
180
189
$requestMatcher = new RequestMatcher(null, 'api.example.com');
181
190
$pluginClient = new PluginClient(
@@ -228,3 +237,7 @@ and also to download an image from a static host::
228
237
it's easier to use the ``RequestConditionalPlugin `` and the ``PluginClient ``,
229
238
but in that case the routing logic is integrated into the linear request flow
230
239
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.
0 commit comments