From 7822527c860e45048f397d83db3773058ba69356 Mon Sep 17 00:00:00 2001 From: Stephane Rathgeber Date: Mon, 23 Dec 2024 16:04:24 +0100 Subject: [PATCH] Remove implicity nullable --- src/DnsRecords.php | 2 +- src/Handlers/Raw/RawDataResponse.php | 2 +- src/Records/RecordFactory.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DnsRecords.php b/src/DnsRecords.php index 0187d17..137c667 100644 --- a/src/DnsRecords.php +++ b/src/DnsRecords.php @@ -20,7 +20,7 @@ class DnsRecords * @param DnsHandlerInterface|null $handler * @param RecordFactory|null $factory */ - public function __construct(DnsHandlerInterface $handler = null, RecordFactory $factory = null) + public function __construct(?DnsHandlerInterface $handler = null, ?RecordFactory $factory = null) { if (is_null($handler)) { $handler = new TCP(); diff --git a/src/Handlers/Raw/RawDataResponse.php b/src/Handlers/Raw/RawDataResponse.php index 9bdc513..12e90f0 100644 --- a/src/Handlers/Raw/RawDataResponse.php +++ b/src/Handlers/Raw/RawDataResponse.php @@ -72,7 +72,7 @@ private function getHeaderQuestionsCount(): int return $this->headerData['qdcount'] ?? 0; } - function readResponse(int $count = 1, int $offset = null): string + function readResponse(int $count = 1, ?int $offset = null): string { if (is_null($offset)) { $return = substr($this->rawBuffer, $this->responseCounter, $count); diff --git a/src/Records/RecordFactory.php b/src/Records/RecordFactory.php index 766666b..9b8522f 100644 --- a/src/Records/RecordFactory.php +++ b/src/Records/RecordFactory.php @@ -28,7 +28,7 @@ class RecordFactory private ExtendedTxtRecords $extendedTxtRecords; - public function __construct(ExtendedTxtRecords $extendedTxtRecords = null) + public function __construct(?ExtendedTxtRecords $extendedTxtRecords = null) { if (is_null($extendedTxtRecords)) { $extendedTxtRecords = new ExtendedTxtRecords();