Skip to content

Commit 218bed6

Browse files
committed
Merge pull request #76 from php-http/guzzle_default_fix
Update guzzle client
2 parents 43c3140 + 2a9c54e commit 218bed6

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
- Client factories for Buzz.
88

9+
### Changed
10+
11+
- Guzzle 6 client is now created according to the Httplug specifications with automated minimal behaviour.
12+
Make sure you configure the Httplug plugins as needed,
13+
for example if you want to get exceptions for failure HTTP status codes.
14+
915

1016
### Fixed
1117

ClientFactory/Guzzle6Factory.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
namespace Http\HttplugBundle\ClientFactory;
44

5-
use GuzzleHttp\Client;
6-
use Http\Adapter\Guzzle6\Client as Adapter;
5+
use Http\Adapter\Guzzle6\Client;
76

87
/**
98
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
@@ -19,8 +18,6 @@ public function createClient(array $config = [])
1918
throw new \LogicException('To use the Guzzle6 adapter you need to install the "php-http/guzzle6-adapter" package.');
2019
}
2120

22-
$client = new Client($config);
23-
24-
return new Adapter($client);
21+
return Client::createWithConfig($config);
2522
}
2623
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"phpunit/phpunit": "^4.5",
2828
"php-http/curl-client": "^1.0",
2929
"php-http/socket-client": "^1.0",
30-
"php-http/guzzle6-adapter": "^1.0",
30+
"php-http/guzzle6-adapter": "^1.1",
3131
"php-http/react-adapter": "^0.1",
3232
"php-http/buzz-adapter": "^0.1",
3333
"php-http/message": "^1.0",
@@ -37,6 +37,7 @@
3737
"puli/symfony-bundle": "^1.0@beta"
3838
},
3939
"conflict": {
40+
"php-http/guzzle6-adapter": "<1.1",
4041
"puli/composer-plugin": "<1.0.0-beta9",
4142
"puli/symfony-bundle": "<=1.0.0-beta7"
4243
},

0 commit comments

Comments
 (0)