Skip to content

Commit dbadb00

Browse files
committed
Use str_increment to avoid PHP 8.5 deprecation
Fixes #398.
1 parent 019f5db commit dbadb00

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

psalm.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@
1717
</projectFiles>
1818

1919
<issueHandlers>
20-
<StringIncrement>
21-
<errorLevel type="suppress">
22-
<directory name="examples"/>
23-
<directory name="src"/>
24-
</errorLevel>
25-
</StringIncrement>
26-
2720
<DocblockTypeContradiction>
2821
<errorLevel type="suppress">
2922
<directory name="src"/>

src/Connection/Internal/Http2ConnectionProcessor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,11 @@ private function ping(): Future
14261426
$this->pongDeferred = $deferred = new DeferredFuture;
14271427
$this->pongWatcher = EventLoop::delay(self::PONG_TIMEOUT, fn () => $this->cancelPongWatcher(false));
14281428

1429-
$this->writeFrame(Http2Parser::PING, data: $this->counter++)->ignore();
1429+
$data = \PHP_VERSION_ID >= 80300
1430+
? $this->counter = \str_increment($this->counter)
1431+
: $this->counter++;
1432+
1433+
$this->writeFrame(Http2Parser::PING, data: $data)->ignore();
14301434

14311435
return $deferred->getFuture();
14321436
}

0 commit comments

Comments
 (0)