Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Strategy/CommonClassesStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ final class CommonClassesStrategy implements DiscoveryStrategy
['class' => React::class, 'condition' => React::class],
],
HttpClient::class => [
['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, [self::class, 'isPsr17FactoryInstalled']]],
['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, [self::class, 'isPsr17FactoryInstalled'], [self::class, 'isSymfonyImplementingHttpClient']]],
['class' => Guzzle7::class, 'condition' => Guzzle7::class],
['class' => Guzzle6::class, 'condition' => Guzzle6::class],
['class' => Guzzle5::class, 'condition' => Guzzle5::class],
Expand Down Expand Up @@ -158,6 +158,11 @@ public static function isGuzzleImplementingPsr18()
return defined('GuzzleHttp\ClientInterface::MAJOR_VERSION');
}

public static function isSymfonyImplementingHttpClient()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static function isSymfonyImplementingHttpClient()
public static function isSymfonyImplementingHttplug()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HttpAsyncClient is kinda Httplug too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree with @arokettu

its not going to be relevant forever, we deprecated the synchronous php-http HttpClient interface in favor of the PSR18 http client. only the async php-http client is still relevant. when we do a new major of discovery, we will drop discovering HttpClient.

{
return is_subclass_of(SymfonyHttplug::class, HttpClient::class);
}

/**
* Can be used as a condition.
*
Expand Down