diff --git a/src/Attachment.php b/src/Attachment.php index 223de45e..e2ce8128 100755 --- a/src/Attachment.php +++ b/src/Attachment.php @@ -462,7 +462,7 @@ public function setConfig(Config $config): Attachment { * @return mixed * @throws MaskNotFoundException */ - public function mask(string $mask = null): mixed { + public function mask(?string $mask = null): mixed { $mask = $mask !== null ? $mask : $this->mask; if (class_exists($mask)) { return new $mask($this); diff --git a/src/Decoder/Decoder.php b/src/Decoder/Decoder.php index 1df68c5e..23b4dc42 100644 --- a/src/Decoder/Decoder.php +++ b/src/Decoder/Decoder.php @@ -54,7 +54,7 @@ public function __construct( * @param string|null $encoding * @return mixed */ - public function decode(array|string|null $value, string $encoding = null): mixed { + public function decode(array|string|null $value, ?string $encoding = null): mixed { return $value; } diff --git a/src/Decoder/DecoderInterface.php b/src/Decoder/DecoderInterface.php index c44f2118..e4874602 100644 --- a/src/Decoder/DecoderInterface.php +++ b/src/Decoder/DecoderInterface.php @@ -33,7 +33,7 @@ public function __construct(array $options = [], string $fallback_encoding = 'UT * @param string|null $encoding * @return string|array|null */ - public function decode(array|string|null $value, string $encoding = null): mixed; + public function decode(array|string|null $value, ?string $encoding = null): mixed; public function mimeHeaderDecode(string $text): array; diff --git a/src/Decoder/HeaderDecoder.php b/src/Decoder/HeaderDecoder.php index 3a98aa6c..9a8a71b2 100644 --- a/src/Decoder/HeaderDecoder.php +++ b/src/Decoder/HeaderDecoder.php @@ -21,7 +21,7 @@ */ class HeaderDecoder extends Decoder { - public function decode(array|string|null $value, string $encoding = null): mixed { + public function decode(array|string|null $value, ?string $encoding = null): mixed { if (is_array($value)) { return $this->decodeHeaderArray($value); } diff --git a/src/Decoder/MessageDecoder.php b/src/Decoder/MessageDecoder.php index 5d4178bc..4a2cff2f 100644 --- a/src/Decoder/MessageDecoder.php +++ b/src/Decoder/MessageDecoder.php @@ -23,7 +23,7 @@ */ class MessageDecoder extends Decoder { - public function decode(array|string|null $value, string $encoding = null): mixed { + public function decode(array|string|null $value, ?string $encoding = null): mixed { if(is_array($value)) { return array_map(function($item){ return $this->decode($item); diff --git a/tests/fixtures/FixtureTestCase.php b/tests/fixtures/FixtureTestCase.php index 00f31157..cb64a9a6 100644 --- a/tests/fixtures/FixtureTestCase.php +++ b/tests/fixtures/FixtureTestCase.php @@ -84,7 +84,7 @@ final public function __construct(?string $name = null, array $data = [], $dataN * @throws ResponseException * @throws RuntimeException */ - final public function getFixture(string $template, Config $config = null) : Message { + final public function getFixture(string $template, ?Config $config = null) : Message { $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", $template]); $message = Message::fromFile($filename, $config); self::assertInstanceOf(Message::class, $message); diff --git a/tests/live/LegacyTest.php b/tests/live/LegacyTest.php index 61e2ee09..3e385eb0 100644 --- a/tests/live/LegacyTest.php +++ b/tests/live/LegacyTest.php @@ -236,7 +236,7 @@ final protected function appendMessageTemplate(Folder $folder, string $template) * @throws ResponseException * @throws RuntimeException */ - final protected function deleteFolder(Folder $folder = null): bool { + final protected function deleteFolder(?Folder $folder = null): bool { $response = $folder?->delete(false); if (is_array($response)) { $valid_response = false; @@ -423,7 +423,7 @@ public function testQueryWhereCriteria(): void { * @throws ResponseException * @throws RuntimeException */ - protected function assertWhereSearchCriteria(Folder $folder, string $criteria, Carbon|string $value = null, bool $date = false): void { + protected function assertWhereSearchCriteria(Folder $folder, string $criteria, Carbon|string|null $value = null, bool $date = false): void { $query = $folder->query()->where($criteria, $value); self::assertInstanceOf(WhereQuery::class, $query); diff --git a/tests/live/LiveMailboxTestCase.php b/tests/live/LiveMailboxTestCase.php index c59e6773..d0f1b680 100644 --- a/tests/live/LiveMailboxTestCase.php +++ b/tests/live/LiveMailboxTestCase.php @@ -200,7 +200,7 @@ final protected function appendMessageTemplate(Folder $folder, string $template) * @throws ResponseException * @throws RuntimeException */ - final protected function deleteFolder(Folder $folder = null): bool { + final protected function deleteFolder(?Folder $folder = null): bool { $response = $folder?->delete(false); if (is_array($response)) { $valid_response = false; diff --git a/tests/live/QueryTest.php b/tests/live/QueryTest.php index 34cd77a4..194d804e 100644 --- a/tests/live/QueryTest.php +++ b/tests/live/QueryTest.php @@ -231,7 +231,7 @@ public function testQueryWhereCriteria(): void { * @throws ResponseException * @throws RuntimeException */ - protected function assertWhereSearchCriteria(Folder $folder, string $criteria, Carbon|string $value = null, bool $date = false): void { + protected function assertWhereSearchCriteria(Folder $folder, string $criteria, Carbon|string|null $value = null, bool $date = false): void { $query = $folder->query()->where($criteria, $value); self::assertInstanceOf(WhereQuery::class, $query);