Skip to content

Commit 30c5e43

Browse files
authored
Merge pull request #223 from WyriHaximus-labs/3.x-nullable
[3.x] Improve PHP 8.4+ support by avoiding implicitly nullable types
2 parents d9681b1 + c15a0d6 commit 30c5e43

5 files changed

+8
-8
lines changed

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
"php": ">=7.1",
3030
"react/cache": "^1.0 || ^0.6 || ^0.5",
3131
"react/event-loop": "^1.2",
32-
"react/promise": "^3.0 || ^2.7 || ^1.2.1"
32+
"react/promise": "^3.2 || ^2.7 || ^1.2.1"
3333
},
3434
"require-dev": {
3535
"phpunit/phpunit": "^9.6 || ^7.5",
36-
"react/async": "^4 || ^3 || ^2",
37-
"react/promise-timer": "^1.9"
36+
"react/async": "^4.3 || ^3 || ^2",
37+
"react/promise-timer": "^1.11"
3838
},
3939
"autoload": {
4040
"psr-4": {

src/Query/TcpTransportExecutor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class TcpTransportExecutor implements ExecutorInterface
135135
* @param string $nameserver
136136
* @param ?LoopInterface $loop
137137
*/
138-
public function __construct($nameserver, LoopInterface $loop = null)
138+
public function __construct($nameserver, ?LoopInterface $loop = null)
139139
{
140140
if (\strpos($nameserver, '[') === false && \substr_count($nameserver, ':') >= 2 && \strpos($nameserver, '://') === false) {
141141
// several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets

src/Query/TimeoutExecutor.php

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

15-
public function __construct(ExecutorInterface $executor, $timeout, LoopInterface $loop = null)
15+
public function __construct(ExecutorInterface $executor, $timeout, ?LoopInterface $loop = null)
1616
{
1717
$this->executor = $executor;
1818
$this->loop = $loop ?: Loop::get();

src/Query/UdpTransportExecutor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ final class UdpTransportExecutor implements ExecutorInterface
9999
* @param string $nameserver
100100
* @param ?LoopInterface $loop
101101
*/
102-
public function __construct($nameserver, LoopInterface $loop = null)
102+
public function __construct($nameserver, ?LoopInterface $loop = null)
103103
{
104104
if (\strpos($nameserver, '[') === false && \substr_count($nameserver, ':') >= 2 && \strpos($nameserver, '://') === false) {
105105
// several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets

src/Resolver/Factory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class Factory
3636
* @throws \InvalidArgumentException for invalid DNS server address
3737
* @throws \UnderflowException when given DNS Config object has an empty list of nameservers
3838
*/
39-
public function create($config, LoopInterface $loop = null)
39+
public function create($config, ?LoopInterface $loop = null)
4040
{
4141
$executor = $this->decorateHostsFileExecutor($this->createExecutor($config, $loop ?: Loop::get()));
4242

@@ -59,7 +59,7 @@ public function create($config, LoopInterface $loop = null)
5959
* @throws \InvalidArgumentException for invalid DNS server address
6060
* @throws \UnderflowException when given DNS Config object has an empty list of nameservers
6161
*/
62-
public function createCached($config, LoopInterface $loop = null, CacheInterface $cache = null)
62+
public function createCached($config, ?LoopInterface $loop = null, ?CacheInterface $cache = null)
6363
{
6464
// default to keeping maximum of 256 responses in cache unless explicitly given
6565
if (!($cache instanceof CacheInterface)) {

0 commit comments

Comments
 (0)