Skip to content

Commit

Permalink
Add Guzzle7 Adapter Client Discovery (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Sep 22, 2020
1 parent 87b580c commit 3d7f833
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ matrix:
- install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter:^1.1.1"
# Test that we find Guzzle 6 v2
- install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter:^2.0.1"
# Test that we find Guzzle 7 Adapter
- install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle7-adapter:^0.1"
# Test that we find a client with Symfony and Guzzle PSR-7
- 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"
# We should fail if we dont have php-http/message-factory or PSR-17
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## Unreleased

- Support discovering HttpClient of `php-http/guzzle7-adapter` https://github.com/php-http/discovery/pull/189

## 1.11.0 - 2020-09-22

- Use correct method name to find Uri Factory in PSR17 https://github.com/php-http/discovery/pull/181
Expand Down
3 changes: 3 additions & 0 deletions src/Strategy/CommonClassesStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Http\Message\UriFactory\SlimUriFactory;
use Slim\Http\Request as SlimRequest;
use GuzzleHttp\Client as GuzzleHttp;
use Http\Adapter\Guzzle7\Client as Guzzle7;
use Http\Adapter\Guzzle6\Client as Guzzle6;
use Http\Adapter\Guzzle5\Client as Guzzle5;
use Http\Client\Curl\Client as Curl;
Expand Down Expand Up @@ -71,12 +72,14 @@ final class CommonClassesStrategy implements DiscoveryStrategy
],
HttpAsyncClient::class => [
['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, Promise::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]],
['class' => Guzzle7::class, 'condition' => Guzzle7::class],
['class' => Guzzle6::class, 'condition' => Guzzle6::class],
['class' => Curl::class, 'condition' => Curl::class],
['class' => React::class, 'condition' => React::class],
],
HttpClient::class => [
['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]],
['class' => Guzzle7::class, 'condition' => Guzzle7::class],
['class' => Guzzle6::class, 'condition' => Guzzle6::class],
['class' => Guzzle5::class, 'condition' => Guzzle5::class],
['class' => Curl::class, 'condition' => Curl::class],
Expand Down

0 comments on commit 3d7f833

Please sign in to comment.