Skip to content

Commit 26e3f7c

Browse files
committed
support client-common 2.0
1 parent 7dff65a commit 26e3f7c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## unreleased
6+
7+
### Changed
8+
9+
- Allow version 2 of `php-http/client-common`
10+
511
## 1.13.1 - 2018-11-28
612

713
### Fixed

DependencyInjection/HttplugExtension.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
namespace Http\HttplugBundle\DependencyInjection;
44

55
use Http\Client\Common\BatchClient;
6+
use Http\Client\Common\BatchClientImpl;
67
use Http\Client\Common\FlexibleHttpClient;
8+
use Http\Client\Common\FlexibleHttpClientImpl;
79
use Http\Client\Common\HttpMethodsClient;
810
use Http\Client\Common\Plugin\AuthenticationPlugin;
911
use Http\Client\Common\PluginClient;
@@ -362,17 +364,19 @@ function ($id) {
362364
}
363365

364366
if ($arguments['http_methods_client']) {
367+
$fqn = class_exists(HttpMethodsClientImpl::class) ? HttpMethodsClientImpl::class : HttpMethodsClient::class;
365368
$container
366-
->register($serviceId.'.http_methods', HttpMethodsClient::class)
369+
->register($serviceId.'.http_methods', $fqn)
367370
->setArguments([new Reference($serviceId.'.http_methods.inner'), new Reference('httplug.message_factory')])
368371
->setPublic($arguments['public'] ? true : false)
369372
->setDecoratedService($serviceId)
370373
;
371374
}
372375

373376
if ($arguments['batch_client']) {
377+
$fqn = class_exists(BatchClientImpl::class) ? BatchClientImpl::class : BatchClient::class;
374378
$container
375-
->register($serviceId.'.batch_client', BatchClient::class)
379+
->register($serviceId.'.batch_client', $fqn)
376380
->setArguments([new Reference($serviceId.'.batch_client.inner')])
377381
->setPublic($arguments['public'] ? true : false)
378382
->setDecoratedService($serviceId)

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^5.5 || ^7.0",
20-
"php-http/client-common": "^1.6",
20+
"php-http/client-common": "^1.6 || ^2.0",
2121
"php-http/client-implementation": "^1.0",
2222
"php-http/cache-plugin": "^1.4",
2323
"php-http/discovery": "^1.0",

0 commit comments

Comments
 (0)