diff --git a/src/Connector.php b/src/Connector.php index 456a3d1..c7b0ac3 100644 --- a/src/Connector.php +++ b/src/Connector.php @@ -15,7 +15,7 @@ class Connector { protected $_connector; protected $_negotiator; - public function __construct(LoopInterface $loop = null, ConnectorInterface $connector = null) { + public function __construct(?LoopInterface $loop = null, ?ConnectorInterface $connector = null) { $this->_loop = $loop ?: Loop::get(); if (null === $connector) { diff --git a/src/functions.php b/src/functions.php index 373afe4..b060fd8 100644 --- a/src/functions.php +++ b/src/functions.php @@ -9,7 +9,7 @@ * @param LoopInterface|null $loop * @return \React\Promise\PromiseInterface<\Ratchet\Client\WebSocket> */ -function connect($url, array $subProtocols = [], $headers = [], LoopInterface $loop = null) { +function connect($url, array $subProtocols = [], $headers = [], ?LoopInterface $loop = null) { $connector = new Connector($loop); $connection = $connector($url, $subProtocols, $headers);