|
11 | 11 |
|
12 | 12 | namespace Symfony\Component\HttpClient;
|
13 | 13 |
|
14 |
| -use FriendsOfPHP\WellKnownImplementations\WellKnownPsr17Factory; |
15 |
| -use FriendsOfPHP\WellKnownImplementations\WellKnownPsr7Request; |
16 |
| -use FriendsOfPHP\WellKnownImplementations\WellKnownPsr7Uri; |
17 | 14 | use GuzzleHttp\Promise\Promise as GuzzlePromise;
|
18 | 15 | use GuzzleHttp\Promise\RejectedPromise;
|
19 | 16 | use GuzzleHttp\Promise\Utils;
|
@@ -84,12 +81,12 @@ public function __construct(HttpClientInterface $client = null, ResponseFactoryI
|
84 | 81 | $this->promisePool = class_exists(Utils::class) ? new \SplObjectStorage() : null;
|
85 | 82 |
|
86 | 83 | if (null === $responseFactory || null === $streamFactory) {
|
87 |
| - if (!class_exists(Psr17Factory::class) && !class_exists(WellKnownPsr17Factory::class) && !class_exists(Psr17FactoryDiscovery::class)) { |
| 84 | + if (!class_exists(Psr17Factory::class) && !class_exists(Psr17FactoryDiscovery::class)) { |
88 | 85 | throw new \LogicException('You cannot use the "Symfony\Component\HttpClient\HttplugClient" as no PSR-17 factories have been provided. Try running "composer require nyholm/psr7".');
|
89 | 86 | }
|
90 | 87 |
|
91 | 88 | try {
|
92 |
| - $psr17Factory = class_exists(Psr17Factory::class, false) ? new Psr17Factory() : (class_exists(WellKnownPsr17Factory::class, false) ? new WellKnownPsr17Factory() : null); |
| 89 | + $psr17Factory = class_exists(Psr17Factory::class, false) ? new Psr17Factory() : null; |
93 | 90 | $responseFactory ??= $psr17Factory ?? Psr17FactoryDiscovery::findResponseFactory();
|
94 | 91 | $streamFactory ??= $psr17Factory ?? Psr17FactoryDiscovery::findStreamFactory();
|
95 | 92 | } catch (NotFoundException $e) {
|
@@ -170,8 +167,6 @@ public function createRequest($method, $uri, array $headers = [], $body = null,
|
170 | 167 | $request = $this->responseFactory->createRequest($method, $uri);
|
171 | 168 | } elseif (class_exists(Request::class)) {
|
172 | 169 | $request = new Request($method, $uri);
|
173 |
| - } elseif (class_exists(WellKnownPsr7Request::class)) { |
174 |
| - $request = new WellKnownPsr7Request($method, $uri); |
175 | 170 | } elseif (class_exists(Psr17FactoryDiscovery::class)) {
|
176 | 171 | $request = Psr17FactoryDiscovery::findRequestFactory()->createRequest($method, $uri);
|
177 | 172 | } else {
|
@@ -249,10 +244,6 @@ public function createUri($uri = ''): UriInterface
|
249 | 244 | return new Uri($uri);
|
250 | 245 | }
|
251 | 246 |
|
252 |
| - if (class_exists(WellKnownPsr7Uri::class)) { |
253 |
| - return new WellKnownPsr7Uri($uri); |
254 |
| - } |
255 |
| - |
256 | 247 | if (class_exists(Psr17FactoryDiscovery::class)) {
|
257 | 248 | return Psr17FactoryDiscovery::findUrlFactory()->createUri($uri);
|
258 | 249 | }
|
|
0 commit comments