From 3e2a6d6a359217391dfb6038ef846c935b05dc56 Mon Sep 17 00:00:00 2001 From: Flavio Heleno Date: Wed, 24 Apr 2024 09:55:53 -0300 Subject: [PATCH] Replace "php-http/discovery" with "psr-discovery/*" --- composer.json | 3 ++- src/Factory.php | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 79c9816..8e005cc 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,8 @@ ], "require": { "php": "^8.1", - "php-http/discovery": "^1.13", + "psr-discovery/http-client-implementations": "^1.2", + "psr-discovery/http-factory-implementations": "^1.1", "psr/http-client": "^1.0", "psr/http-client-implementation": "^1.0", "psr/http-factory": "^1.0", diff --git a/src/Factory.php b/src/Factory.php index efb28eb..26ac531 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -3,14 +3,13 @@ namespace Pickling; -use Http\Discovery\Psr17FactoryDiscovery; -use Http\Discovery\Psr18ClientDiscovery; use Pickling\Channel\ChannelInterface; use Pickling\Channel\PearChannel; use Pickling\Channel\PeclChannel; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; +use PsrDiscovery\Discover; final class Factory { public static function create( @@ -21,9 +20,9 @@ public static function create( ): Client { return new Client( $channel, - $httpClient ?: Psr18ClientDiscovery::find(), - $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory(), - $streamFactory ?: Psr17FactoryDiscovery::findStreamFactory() + $httpClient ?: Discover::httpClient(), + $requestFactory ?: Discover::httpRequestFactory(), + $streamFactory ?: Discover::httpStreamFactory() ); } public static function createPear(