Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f5238d

Browse files
bug #44890 [HttpClient] Remove deprecated usage of GuzzleHttp\Promise\queue (GrahamCampbell)
This PR was submitted for the 5.4 branch but it was merged into the 4.4 branch instead. Discussion ---------- [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `GuzzleHttp\Promise\queue` was deprecated in `1.4.0` in favour of `GuzzleHttp\Promise\Utils::queue`, to enable PSR-4 compliance and eliminate issues with multiple installs globally and locally. Since the minimum version of this package in Symfony's composer.json is `1.4.0` (`^1.4`), then this change should be safe to make. --- cc `@Nyholm` Commits ------- 5130dd5 [HttpClient] Remove deprecated usage of `GuzzleHttp\Promise\queue`
2 parents 727842f + 5130dd5 commit 9f5238d

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)