reactphp / http

Event-driven, streaming HTTP client and server implementation for ReactPHP.
https://reactphp.org/http/
MIT License
747 stars 143 forks source link

Drop deprecated alternative `Browser` constructor argument order #529

Closed clue closed 5 months ago

clue commented 5 months ago

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 = new React\Http\Browser();

// old (no longer supported)
$browser = new React\Http\Browser(null, $connector);
$browser = new React\Http\Browser($loop, $connector);

// new (already supported since v1.5.0)
$browser = new React\Http\Browser($connector);
$browser = new React\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 https://github.com/reactphp/promise/pull/260. Additionally, a follow-up PR should drop the entire $loop argument as discussed in #517.

Builds on top of #418, #528 and https://github.com/reactphp/socket/pull/315.