Skip to content

Commit 3d7f833

Browse files
authored
Add Guzzle7 Adapter Client Discovery (#189)
1 parent 87b580c commit 3d7f833

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ matrix:
6565
- install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter:^1.1.1"
6666
# Test that we find Guzzle 6 v2
6767
- install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter:^2.0.1"
68+
# Test that we find Guzzle 7 Adapter
69+
- install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle7-adapter:^0.1"
6870
# Test that we find a client with Symfony and Guzzle PSR-7
6971
- install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug php-http/message-factory guzzlehttp/psr7:1.* http-interop/http-factory-guzzle"
7072
# We should fail if we dont have php-http/message-factory or PSR-17

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## Unreleased
4+
5+
- Support discovering HttpClient of `php-http/guzzle7-adapter` https://github.com/php-http/discovery/pull/189
6+
37
## 1.11.0 - 2020-09-22
48

59
- Use correct method name to find Uri Factory in PSR17 https://github.com/php-http/discovery/pull/181

src/Strategy/CommonClassesStrategy.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use Http\Message\UriFactory\SlimUriFactory;
2828
use Slim\Http\Request as SlimRequest;
2929
use GuzzleHttp\Client as GuzzleHttp;
30+
use Http\Adapter\Guzzle7\Client as Guzzle7;
3031
use Http\Adapter\Guzzle6\Client as Guzzle6;
3132
use Http\Adapter\Guzzle5\Client as Guzzle5;
3233
use Http\Client\Curl\Client as Curl;
@@ -71,12 +72,14 @@ final class CommonClassesStrategy implements DiscoveryStrategy
7172
],
7273
HttpAsyncClient::class => [
7374
['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, Promise::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]],
75+
['class' => Guzzle7::class, 'condition' => Guzzle7::class],
7476
['class' => Guzzle6::class, 'condition' => Guzzle6::class],
7577
['class' => Curl::class, 'condition' => Curl::class],
7678
['class' => React::class, 'condition' => React::class],
7779
],
7880
HttpClient::class => [
7981
['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]],
82+
['class' => Guzzle7::class, 'condition' => Guzzle7::class],
8083
['class' => Guzzle6::class, 'condition' => Guzzle6::class],
8184
['class' => Guzzle5::class, 'condition' => Guzzle5::class],
8285
['class' => Curl::class, 'condition' => Curl::class],

0 commit comments

Comments
 (0)