Skip to content

Commit e04478a

Browse files
authored
Merge pull request #317 from clue-labs/nullable-v3
[3.x] Improve PHP 8.4+ support by avoiding implicitly nullable types
2 parents 9f04466 + 4ee049d commit e04478a

11 files changed

+15
-15
lines changed

composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
"require": {
2929
"php": ">=7.1",
3030
"evenement/evenement": "^3.0 || ^2.0 || ^1.0",
31-
"react/dns": "^1.11",
31+
"react/dns": "^1.13",
3232
"react/event-loop": "^1.2",
33-
"react/promise": "^3 || ^2.6 || ^1.2.1",
34-
"react/stream": "^1.2"
33+
"react/promise": "^3.2 || ^2.6 || ^1.2.1",
34+
"react/stream": "^1.4"
3535
},
3636
"require-dev": {
3737
"phpunit/phpunit": "^9.6 || ^7.5",
38-
"react/async": "^4 || ^3",
38+
"react/async": "^4.3 || ^3",
3939
"react/promise-stream": "^1.4",
40-
"react/promise-timer": "^1.10"
40+
"react/promise-timer": "^1.11"
4141
},
4242
"autoload": {
4343
"psr-4": {

src/Connector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ final class Connector implements ConnectorInterface
5050
* @param ?LoopInterface $loop
5151
* @throws \InvalidArgumentException for invalid arguments
5252
*/
53-
public function __construct(array $context = array(), LoopInterface $loop = null)
53+
public function __construct(array $context = [], ?LoopInterface $loop = null)
5454
{
5555
// apply default options if not explicitly given
5656
$context += [

src/FdServer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ final class FdServer extends EventEmitter implements ServerInterface
7575
* @throws \InvalidArgumentException if the listening address is invalid
7676
* @throws \RuntimeException if listening on this address fails (already in use etc.)
7777
*/
78-
public function __construct($fd, LoopInterface $loop = null)
78+
public function __construct($fd, ?LoopInterface $loop = null)
7979
{
8080
if (\preg_match('#^php://fd/(\d+)$#', $fd, $m)) {
8181
$fd = (int) $m[1];

src/SecureConnector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class SecureConnector implements ConnectorInterface
1313
private $streamEncryption;
1414
private $context;
1515

16-
public function __construct(ConnectorInterface $connector, LoopInterface $loop = null, array $context = [])
16+
public function __construct(ConnectorInterface $connector, ?LoopInterface $loop = null, array $context = [])
1717
{
1818
$this->connector = $connector;
1919
$this->streamEncryption = new StreamEncryption($loop ?? Loop::get(), false);

src/SecureServer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ final class SecureServer extends EventEmitter implements ServerInterface
119119
* @see TcpServer
120120
* @link https://www.php.net/manual/en/context.ssl.php for TLS context options
121121
*/
122-
public function __construct(ServerInterface $tcp, LoopInterface $loop = null, array $context = [])
122+
public function __construct(ServerInterface $tcp, ?LoopInterface $loop = null, array $context = [])
123123
{
124124
// default to empty passphrase to suppress blocking passphrase prompt
125125
$context += [

src/SocketServer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class SocketServer extends EventEmitter implements ServerInterface
3131
* @throws \InvalidArgumentException if the listening address is invalid
3232
* @throws \RuntimeException if listening on this address fails (already in use etc.)
3333
*/
34-
public function __construct($uri, array $context = [], LoopInterface $loop = null)
34+
public function __construct($uri, array $context = [], ?LoopInterface $loop = null)
3535
{
3636
// apply default options if not explicitly given
3737
$context += [

src/TcpConnector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class TcpConnector implements ConnectorInterface
1212
private $loop;
1313
private $context;
1414

15-
public function __construct(LoopInterface $loop = null, array $context = [])
15+
public function __construct(?LoopInterface $loop = null, array $context = [])
1616
{
1717
$this->loop = $loop ?? Loop::get();
1818
$this->context = $context;

src/TcpServer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ final class TcpServer extends EventEmitter implements ServerInterface
126126
* @throws \InvalidArgumentException if the listening address is invalid
127127
* @throws \RuntimeException if listening on this address fails (already in use etc.)
128128
*/
129-
public function __construct($uri, LoopInterface $loop = null, array $context = [])
129+
public function __construct($uri, ?LoopInterface $loop = null, array $context = [])
130130
{
131131
$this->loop = $loop ?? Loop::get();
132132

src/TimeoutConnector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class TimeoutConnector implements ConnectorInterface
1212
private $timeout;
1313
private $loop;
1414

15-
public function __construct(ConnectorInterface $connector, $timeout, LoopInterface $loop = null)
15+
public function __construct(ConnectorInterface $connector, $timeout, ?LoopInterface $loop = null)
1616
{
1717
$this->connector = $connector;
1818
$this->timeout = $timeout;

src/UnixConnector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class UnixConnector implements ConnectorInterface
1717
{
1818
private $loop;
1919

20-
public function __construct(LoopInterface $loop = null)
20+
public function __construct(?LoopInterface $loop = null)
2121
{
2222
$this->loop = $loop ?? Loop::get();
2323
}

src/UnixServer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class UnixServer extends EventEmitter implements ServerInterface
4848
* @throws \InvalidArgumentException if the listening address is invalid
4949
* @throws \RuntimeException if listening on this address fails (already in use etc.)
5050
*/
51-
public function __construct($path, LoopInterface $loop = null, array $context = [])
51+
public function __construct($path, ?LoopInterface $loop = null, array $context = [])
5252
{
5353
$this->loop = $loop ?? Loop::get();
5454

0 commit comments

Comments
 (0)