Skip to content

Commit

Permalink
Replace "php-http/discovery" with "psr-discovery/*"
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioheleno committed Apr 24, 2024
1 parent fc4c9c2 commit 3e2a6d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 4 additions & 5 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 3e2a6d6

Please sign in to comment.