8000 [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue` · symfony/symfony@5130dd5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5130dd5

Browse files
GrahamCampbellnicolas-grekas
authored andcommitted
[HttpClient] Remove deprecated usage of GuzzleHttp\Promise\queue
1 parent 727842f commit 5130dd5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Component/HttpClient/HttplugClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use GuzzleHttp\Promise\Promise as GuzzlePromise;
1515
use GuzzleHttp\Promise\RejectedPromise;
16+
use GuzzleHttp\Promise\Utils;
1617
use Http\Client\Exception\NetworkException;
1718
use Http\Client\Exception\RequestException;
1819
use Http\Client\HttpAsyncClient;
@@ -69,7 +70,7 @@ public function __construct(HttpClientInterface $client = null, ResponseFactoryI
6970
$this->client = $client ?? HttpClient::create();
7071
$this->responseFactory = $responseFactory;
7172
$this->streamFactory = $streamFactory ?? ($responseFactory instanceof StreamFactoryInterface ? $responseFactory : null);
72-
$this->promisePool = \function_exists('GuzzleHttp\Promise\queue') ? new \SplObjectStorage() : null;
73+
$this->promisePool = class_exists(Utils::class) ? new \SplObjectStorage() : null;
7374

7475
if (null === $this->responseFactory || null === $this->streamFactory) {
7576
if (!class_exists(Psr17Factory::class) && !class_exists(Psr17FactoryDiscovery::class)) {

src/Symfony/Component/HttpClient/Internal/HttplugWaitLoop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function wait(?ResponseInterface $pendingResponse, float $maxDuration = n
4747
return 0;
4848
}
4949

50-
$guzzleQueue = \GuzzleHttp\Promise\queue();
50+
$guzzleQueue = \GuzzleHttp\Promise\Utils::queue();
5151

5252
if (0.0 === $remainingDuration = $maxDuration) {
5353
$idleTimeout = 0.0;

0 commit comments

Comments
 (0)
0