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

[3.x] Improve PHP 8.4+ support by avoiding implicitly nullable types #223

Merged
merged 1 commit into from
Jun 5, 2024
Merged
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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"php": ">=7.1",
"react/cache": "^1.0 || ^0.6 || ^0.5",
"react/event-loop": "^1.2",
"react/promise": "^3.0 || ^2.7 || ^1.2.1"
"react/promise": "^3.2 || ^2.7 || ^1.2.1"
},
"require-dev": {
"phpunit/phpunit": "^9.6 || ^7.5",
"react/async": "^4 || ^3 || ^2",
"react/promise-timer": "^1.9"
"react/async": "^4.3 || ^3 || ^2",
"react/promise-timer": "^1.11"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Query/TcpTransportExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class TcpTransportExecutor implements ExecutorInterface
* @param string $nameserver
* @param ?LoopInterface $loop
*/
public function __construct($nameserver, LoopInterface $loop = null)
public function __construct($nameserver, ?LoopInterface $loop = null)
{
if (\strpos($nameserver, '[') === false && \substr_count($nameserver, ':') >= 2 && \strpos($nameserver, '://') === false) {
// several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets
Expand Down
2 changes: 1 addition & 1 deletion src/Query/TimeoutExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class TimeoutExecutor implements ExecutorInterface
private $loop;
private $timeout;

public function __construct(ExecutorInterface $executor, $timeout, LoopInterface $loop = null)
public function __construct(ExecutorInterface $executor, $timeout, ?LoopInterface $loop = null)
{
$this->executor = $executor;
$this->loop = $loop ?: Loop::get();
Expand Down
2 changes: 1 addition & 1 deletion src/Query/UdpTransportExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ final class UdpTransportExecutor implements ExecutorInterface
* @param string $nameserver
* @param ?LoopInterface $loop
*/
public function __construct($nameserver, LoopInterface $loop = null)
public function __construct($nameserver, ?LoopInterface $loop = null)
{
if (\strpos($nameserver, '[') === false && \substr_count($nameserver, ':') >= 2 && \strpos($nameserver, '://') === false) {
// several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets
Expand Down
4 changes: 2 additions & 2 deletions src/Resolver/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class Factory
* @throws \InvalidArgumentException for invalid DNS server address
* @throws \UnderflowException when given DNS Config object has an empty list of nameservers
*/
public function create($config, LoopInterface $loop = null)
public function create($config, ?LoopInterface $loop = null)
{
$executor = $this->decorateHostsFileExecutor($this->createExecutor($config, $loop ?: Loop::get()));

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