Skip to content

Work around Psr7\Request deprecation warnings - #1121

Closed
lachlan-00 wants to merge 1 commit into
ratchetphp:0.4.xfrom
lachlan-00:0.4.x
Closed

Work around Psr7\Request deprecation warnings#1121
lachlan-00 wants to merge 1 commit into
ratchetphp:0.4.xfrom
lachlan-00:0.4.x

Conversation

@lachlan-00

Copy link
Copy Markdown

I've gotten around to fixing an Ampache feature that uses ratchet and becuse i'm basing it on php8.5 i'm getting a lot of deprecation warnings.

06/Aug/2026:05:51:18 +1000 [ampache] (log.lib) -> [Error] Creation of dynamic property React\Socket\Connection::$decor is deprecated in file /var/www/music/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php(83)
06/Aug/2026:05:51:18 +1000 [ampache] (log.lib) -> [Error] Creation of dynamic property Ratchet\Server\IoConnection::$resourceId is deprecated in file /var/www/music/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php(84)
06/Aug/2026:05:51:18 +1000 [ampache] (log.lib) -> [Error] Creation of dynamic property Ratchet\Server\IoConnection::$remoteAddress is deprecated in file /var/www/music/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php(87)
06/Aug/2026:05:51:18 +1000 [ampache] (log.lib) -> [Error] Creation of dynamic property Ratchet\Server\IoConnection::$httpHeadersReceived is deprecated in file /var/www/music/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php(33)
06/Aug/2026:05:51:24 +1000 [ampache] (log.lib) -> [Error] Creation of dynamic property Ratchet\Server\IoConnection::$httpBuffer is deprecated in file /var/www/music/vendor/cboden/ratchet/src/Ratchet/Http/HttpRequestParser.php(30)
06/Aug/2026:05:51:24 +1000 [ampache] (log.lib) -> [Error] Creation of dynamic property Ratchet\Server\IoConnection::$controller is deprecated in file /var/www/music/vendor/cboden/ratchet/src/Ratchet/Http/Router.php(34)

I had a look and they seem to be issues with guzzle but this pull works around them to stop the warnings occurring by taking out the http factory that's firing the warnings.

I'll file an issue with guzzle as well to see if that's simple enough for them to avoid the workaround.

@clue

clue commented Aug 6, 2026

Copy link
Copy Markdown
Member

@lachlan-00 Thanks for digging into this, and great to see Ratchet powering Ampache. Good to see tests for the rejected upgrade path too.

The deprecations in your log are all dynamic property notices from IoServer.php, and those are already fixed on 0.4.x via #1096. Your line numbers 83/84/87 match v0.4.4, which is what Composer still installs because the last release is from 2021. composer require cboden/ratchet:^0.4@dev gets you the current branch in the meantime (#1120).

The deprecation this PR actually works around is a different one, the int that ServerNegotiator passes to withHeader() for Sec-WebSocket-Version. That one is real, and it's already fixed at the source in ratchetphp/RFC6455#79, which also covers ClientNegotiator for the client side. It's milestoned for rfc6455 0.4.2 and Ratchet's existing ^0.4.0 constraint picks it up on a plain composer update, so no change is needed here.

Both fixes are part of the larger effort reviving Ratchet as discussed in #1054, which has been working through a lot of these along the way. Getting the releases out is the remaining piece.

Closing this for now, the fix lives upstream. If you want to bring the handshake tests back as a separate PR once rfc6455 0.4.2 is out, that'd be welcome 👍

@clue clue closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants