Skip to content

Commit

Permalink
support client-common 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Dec 13, 2018
1 parent 7dff65a commit 29737ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,12 @@

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

## unreleased

### Changed

- Allow version 2 of `php-http/client-common`

## 1.13.1 - 2018-11-28

### Fixed
Expand Down
8 changes: 6 additions & 2 deletions DependencyInjection/HttplugExtension.php
Expand Up @@ -3,8 +3,10 @@
namespace Http\HttplugBundle\DependencyInjection;

use Http\Client\Common\BatchClient;
use Http\Client\Common\BatchClientImpl;
use Http\Client\Common\FlexibleHttpClient;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientImpl;
use Http\Client\Common\Plugin\AuthenticationPlugin;
use Http\Client\Common\PluginClient;
use Http\Client\Common\PluginClientFactory;
Expand Down Expand Up @@ -362,17 +364,19 @@ function ($id) {
}

if ($arguments['http_methods_client']) {
$fqn = class_exists(HttpMethodsClientImpl::class) ? HttpMethodsClientImpl::class : HttpMethodsClient::class;
$container
->register($serviceId.'.http_methods', HttpMethodsClient::class)
->register($serviceId.'.http_methods', $fqn)
->setArguments([new Reference($serviceId.'.http_methods.inner'), new Reference('httplug.message_factory')])
->setPublic($arguments['public'] ? true : false)
->setDecoratedService($serviceId)
;
}

if ($arguments['batch_client']) {
$fqn = class_exists(BatchClientImpl::class) ? BatchClientImpl::class : BatchClient::class;
$container
->register($serviceId.'.batch_client', BatchClient::class)
->register($serviceId.'.batch_client', $fqn)
->setArguments([new Reference($serviceId.'.batch_client.inner')])
->setPublic($arguments['public'] ? true : false)
->setDecoratedService($serviceId)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -17,7 +17,7 @@
],
"require": {
"php": "^5.5 || ^7.0",
"php-http/client-common": "^1.6",
"php-http/client-common": "^1.6 || ^2.0",
"php-http/client-implementation": "^1.0",
"php-http/cache-plugin": "^1.4",
"php-http/discovery": "^1.0",
Expand Down

0 comments on commit 29737ee

Please sign in to comment.