From 2a9c54e2b9418780b75a1b76d4bb80d31f6438a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rk=20S=C3=A1gi-Kaz=C3=A1r?= Date: Mon, 9 May 2016 23:54:56 +0200 Subject: [PATCH] Update guzzle client, closes #74 --- CHANGELOG.md | 6 ++++++ ClientFactory/Guzzle6Factory.php | 7 ++----- composer.json | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5791a289..c9b65ddd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ - Client factories for Buzz. +### Changed + +- Guzzle 6 client is now created according to the Httplug specifications with automated minimal behaviour. + Make sure you configure the Httplug plugins as needed, + for example if you want to get exceptions for failure HTTP status codes. + ## 1.0.0 - 2016-03-04 diff --git a/ClientFactory/Guzzle6Factory.php b/ClientFactory/Guzzle6Factory.php index 3a5255c6..802f9e52 100644 --- a/ClientFactory/Guzzle6Factory.php +++ b/ClientFactory/Guzzle6Factory.php @@ -2,8 +2,7 @@ namespace Http\HttplugBundle\ClientFactory; -use GuzzleHttp\Client; -use Http\Adapter\Guzzle6\Client as Adapter; +use Http\Adapter\Guzzle6\Client; /** * @author Tobias Nyholm @@ -19,8 +18,6 @@ public function createClient(array $config = []) throw new \LogicException('To use the Guzzle6 adapter you need to install the "php-http/guzzle6-adapter" package.'); } - $client = new Client($config); - - return new Adapter($client); + return Client::createWithConfig($config); } } diff --git a/composer.json b/composer.json index b92ceda2..b7605c77 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "phpunit/phpunit": "^4.5", "php-http/curl-client": "^1.0", "php-http/socket-client": "^1.0", - "php-http/guzzle6-adapter": "^1.0", + "php-http/guzzle6-adapter": "^1.1", "php-http/react-adapter": "^0.1", "php-http/buzz-adapter": "^0.1", "php-http/message": "^1.0", @@ -37,6 +37,7 @@ "puli/symfony-bundle": "^1.0@beta" }, "conflict": { + "php-http/guzzle6-adapter": "<1.1", "puli/composer-plugin": "<1.0.0-beta9", "puli/symfony-bundle": "<=1.0.0-beta7" },