Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop deprecated Server class, use SocketServer instead #314

Merged
merged 1 commit into from
May 23, 2024

Conversation

clue
Copy link
Member

@clue clue commented May 22, 2024

This simple changeset drops the deprecated Server class from this package. As of v1.9.0, we recommend using the SocketServer class instead to avoid class name collisions, so upgrading should be straightforward for most use cases:

// old (no longer supported)
$socket = new React\Socket\Server(0);
$socket = new React\Socket\Server('127.0.0.1:8000');
$socket = new React\Socket\Server('127.0.0.1:8000', null, $context);
$socket = new React\Socket\Server('127.0.0.1:8000', $loop, $context);

// new (already supported since v1.9.0)
$socket = new React\Socket\SocketServer('127.0.0.1:0');
$socket = new React\Socket\SocketServer('127.0.0.1:8000');
$socket = new React\Socket\SocketServer('127.0.0.1:8000', $context);
$socket = new React\Socket\SocketServer('127.0.0.1:8000', $context, $loop);

The original deprecation message has been in place for a couple of years already, so this should be relatively safe to apply.

Builds on top of #263.

Copy link
Member

@SimonFrings SimonFrings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's get this in 👍

Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@WyriHaximus WyriHaximus merged commit 874deeb into reactphp:3.x May 23, 2024
28 checks passed
@clue clue deleted the drop-server branch May 23, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants