Replace deprecated spl_object_hash() with spl_object_id() in ConnectionErrorProof (#1738)

php 8.6 deprecates spl_object_hash(). ConnectionErrorProof only uses it as an array key for per-connection exceptions, so spl_object_id() is a drop-in replacement. added a dedicated test for the pipeline.
This commit is contained in:
dualfroz committed 2026-10-08 10:41:25 +03:00
1 parent 869eb626d4
commit 839ef60ab2
3 files changed
+165 -4

No files matched your search

+4 -4
View File
@@ -101,10 +101,10 @@ class ConnectionErrorProof extends Pipeline
$command = $commands->dequeue();
$cmdConnection = $connection->getConnectionByCommand($command);
$connectionHash = spl_object_hash($cmdConnection);
$connectionId = spl_object_id($cmdConnection);
if (isset($exceptions[$connectionHash])) {
$responses[$i] = $exceptions[$connectionHash];
if (isset($exceptions[$connectionId])) {
$responses[$i] = $exceptions[$connectionId];
continue;
}
@@ -112,7 +112,7 @@ class ConnectionErrorProof extends Pipeline
$responses[$i] = $cmdConnection->readResponse($command);
} catch (CommunicationException $exception) {
$responses[$i] = $exception;
$exceptions[$connectionHash] = $exception;
$exceptions[$connectionId] = $exception;
}
}