Skip to content

Drop deprecated alternative Browser constructor argument order - #529

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

Drop deprecated alternative Browser constructor argument order#529
WyriHaximus merged 1 commit into
reactphp:3.xfrom
clue-labs:drop-browser-alternative

Conversation

@clue

@clueclue commented May 24, 2024

Copy link
Copy Markdown
Member

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

// unchanged$browser = newReact\Http\Browser();
// old (no longer supported)$browser = newReact\Http\Browser(null, $connector);
$browser = newReact\Http\Browser($loop, $connector);
// new (already supported since v1.5.0)$browser = newReact\Http\Browser($connector);
$browser = newReact\Http\Browser($connector, $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 #517.

Builds on top of #418, #528 and reactphp/socket#315.

@clueclue added this to the v3.0.0 milestone May 24, 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, looks good to me 👍

@clueclue mentioned this pull request May 24, 2024
@WyriHaximus
WyriHaximus merged commit da8ee09 into reactphp:3.xMay 24, 2024
@clue
clue deleted the drop-browser-alternative branch May 24, 2024 20:01
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