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

PHP 8.4 Implicitly marking parameter <x> as nullable is deprecated #1077

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Ratchet/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class App {
* @param LoopInterface $loop Specific React\EventLoop to bind the application to. null will create one for you.
* @param array $context
*/
public function __construct($httpHost = 'localhost', $port = 8080, $address = '127.0.0.1', LoopInterface $loop = null, $context = array()) {
public function __construct($httpHost = 'localhost', $port = 8080, $address = '127.0.0.1', ?LoopInterface $loop = null, $context = array()) {
if (extension_loaded('xdebug') && getenv('RATCHET_DISABLE_XDEBUG_WARN') === false) {
trigger_error('XDebug extension detected. Remember to disable this if performance testing or going live!', E_USER_WARNING);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ratchet/Http/HttpServerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ interface HttpServerInterface extends MessageComponentInterface {
* @param \Psr\Http\Message\RequestInterface $request null is default because PHP won't let me overload; don't pass null!!!
* @throws \UnexpectedValueException if a RequestInterface is not passed
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null);
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null);
}
2 changes: 1 addition & 1 deletion src/Ratchet/Http/NoOpHttpServerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Psr\Http\Message\RequestInterface;

class NoOpHttpServerController implements HttpServerInterface {
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
}

public function onMessage(ConnectionInterface $from, $msg) {
Expand Down
2 changes: 1 addition & 1 deletion src/Ratchet/Http/OriginCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(MessageComponentInterface $component, array $allowed
/**
* {@inheritdoc}
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
$header = (string)$request->getHeader('Origin')[0];
$origin = parse_url($header, PHP_URL_HOST) ?: $header;

Expand Down
2 changes: 1 addition & 1 deletion src/Ratchet/Http/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(UrlMatcherInterface $matcher) {
* {@inheritdoc}
* @throws \UnexpectedValueException If a controller is not \Ratchet\Http\HttpServerInterface
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
if (null === $request) {
throw new \UnexpectedValueException('$request can not be null');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ratchet/Server/IoServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class IoServer {
* @param \React\Socket\ServerInterface $socket The React socket server to run the Ratchet application off of
* @param \React\EventLoop\LoopInterface|null $loop The React looper to run the Ratchet application off of
*/
public function __construct(MessageComponentInterface $app, ServerInterface $socket, LoopInterface $loop = null) {
public function __construct(MessageComponentInterface $app, ServerInterface $socket, ?LoopInterface $loop = null) {
if (false === strpos(PHP_VERSION, "hiphop")) {
gc_enable();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ratchet/Session/SessionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct(HttpServerInterface $app, \SessionHandlerInterface $
/**
* {@inheritdoc}
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
$sessionName = ini_get('session.name');

$id = array_reduce($request->getHeader('Cookie'), function($accumulator, $cookie) use ($sessionName) {
Expand Down
2 changes: 1 addition & 1 deletion src/Ratchet/WebSocket/WsServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function __construct(ComponentInterface $component) {
/**
* {@inheritdoc}
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
if (null === $request) {
throw new \UnexpectedValueException('$request can not be null');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/Ratchet/Mock/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Component implements MessageComponentInterface, WsServerInterface {

public $protocols = array();

public function __construct(ComponentInterface $app = null) {
public function __construct(?ComponentInterface $app = null) {
$this->last[__FUNCTION__] = func_get_args();
}

Expand Down