diff --git a/CHANGELOG.md b/CHANGELOG.md index 106fc97..ce273e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 2.7.4 - unreleased + +- Fix `spl_object_hash` deprecation on PHP 8.6. + ## 2.7.3 - 2025-11-29 - Allow installation with Symfony 8. diff --git a/composer.json b/composer.json index bca9932..922d03c 100644 --- a/composer.json +++ b/composer.json @@ -52,6 +52,11 @@ ] }, "config": { - "sort-packages": true + "sort-packages": true, + "policy": { + "advisories": { + "ignore": ["guzzlehttp/psr7"] + } + } } } diff --git a/src/Plugin/RedirectPlugin.php b/src/Plugin/RedirectPlugin.php index 8aebcbf..b2c1d15 100644 --- a/src/Plugin/RedirectPlugin.php +++ b/src/Plugin/RedirectPlugin.php @@ -178,7 +178,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl $uri = $this->createUri($response, $request); $redirectRequest = $this->buildRedirectRequest($request, $uri, $statusCode); - $chainIdentifier = spl_object_hash((object) $first); + $chainIdentifier = \PHP_VERSION_ID < 70200 ? spl_object_hash((object) $first) : (string) spl_object_id((object) $first); if (!array_key_exists($chainIdentifier, $this->circularDetection)) { $this->circularDetection[$chainIdentifier] = []; diff --git a/src/Plugin/RetryPlugin.php b/src/Plugin/RetryPlugin.php index 992bb21..edd3fe3 100644 --- a/src/Plugin/RetryPlugin.php +++ b/src/Plugin/RetryPlugin.php @@ -98,7 +98,7 @@ public function __construct(array $config = []) public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise { - $chainIdentifier = spl_object_hash((object) $first); + $chainIdentifier = \PHP_VERSION_ID < 70200 ? spl_object_hash((object) $first) : (string) spl_object_id((object) $first); return $next($request)->then(function (ResponseInterface $response) use ($request, $next, $first, $chainIdentifier) { if (!array_key_exists($chainIdentifier, $this->retryStorage)) {