Skip to content

Drop deprecated alternative Connector constructor argument order - #315

Merged
WyriHaximus merged 1 commit into
reactphp:3.xfrom
clue-labs:drop-connector-alternative
May 31, 2024
Merged

Drop deprecated alternative Connector constructor argument order#315
WyriHaximus merged 1 commit into
reactphp:3.xfrom
clue-labs:drop-connector-alternative

Conversation

@clue

@clueclue commented May 22, 2024

Copy link
Copy Markdown
Member

This simple changeset drops the deprecated alternative Connector constructor argument order. As of v1.9.0, we recommend using the new Connector signature with the optional $context as first argument and optional $loop as second argument, so upgrading should be straightforward for most use cases:

// unchanged$connector = newReact\Socket\Connector();
// old (no longer supported)$connector = newReact\Socket\Connector(null, $context);
$connector = newReact\Socket\Connector($loop, $context);
// new (already supported since v1.9.0)$connector = newReact\Socket\Connector($context);
$connector = newReact\Socket\Connector($context, $loop);

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

Note that this temporarily introduces an implicitly nullable type that should be removed in a follow-up as discussed in reactphp/promise#260. Additionally, a follow-up PR should drop the entire $loop argument as discussed in #312.

Builds on top of #264 and #314.

@clueclue added this to the v3.0.0 milestone May 22, 2024
@clueclue mentioned this pull request May 22, 2024

@SimonFringsSimonFrings left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, let's get this shipped 👍

Comment threadsrc/Connector.php
@WyriHaximus
WyriHaximus merged commit a2b4fe1 into reactphp:3.xMay 31, 2024
@clue
clue deleted the drop-connector-alternative branch May 31, 2024 10:36
Sign up for freeto 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

@clue@WyriHaximus@SimonFrings