From c0cc1363491f9ffd24515ca150a484b9a594feb6 Mon Sep 17 00:00:00 2001 From: yoeriwalstra Date: Tue, 2 Jun 2026 10:55:00 +0200 Subject: [PATCH] :hankey: more implicitly nullable parameters --- src/Errors/AbstractCarrierError.php | 2 +- src/Exceptions/AbstractException.php | 2 +- src/Exceptions/AbstractMultiErrorException.php | 2 +- src/Transformers/AbstractTransformer.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Errors/AbstractCarrierError.php b/src/Errors/AbstractCarrierError.php index 11c5272..f5300fd 100644 --- a/src/Errors/AbstractCarrierError.php +++ b/src/Errors/AbstractCarrierError.php @@ -23,7 +23,7 @@ public function __construct( protected string $errorCode, protected string $title, protected string $detail, - string $pointer = null, + ?string $pointer = null, ) { if ($pointer !== null) { $this->setPointer($pointer); diff --git a/src/Exceptions/AbstractException.php b/src/Exceptions/AbstractException.php index 2b94192..949274b 100644 --- a/src/Exceptions/AbstractException.php +++ b/src/Exceptions/AbstractException.php @@ -27,7 +27,7 @@ public function __construct( protected string $detail, array $errorType, protected int $status, - Throwable $previous = null, + ?Throwable $previous = null, ) { $this->setErrorCode($errorType['code']); $this->setTitle($errorType['title']); diff --git a/src/Exceptions/AbstractMultiErrorException.php b/src/Exceptions/AbstractMultiErrorException.php index d5025dd..c4f1425 100644 --- a/src/Exceptions/AbstractMultiErrorException.php +++ b/src/Exceptions/AbstractMultiErrorException.php @@ -15,7 +15,7 @@ abstract class AbstractMultiErrorException extends Exception implements MultiErr public function __construct( protected array $errors, protected int $status, - Throwable $previous = null, + ?Throwable $previous = null, ) { parent::__construct('Response contains multiple errors.', $status, $previous); } diff --git a/src/Transformers/AbstractTransformer.php b/src/Transformers/AbstractTransformer.php index bb34f3a..d0bc9e7 100644 --- a/src/Transformers/AbstractTransformer.php +++ b/src/Transformers/AbstractTransformer.php @@ -92,7 +92,7 @@ protected function transformRelationshipForIdentifier( string $id, UnitEnum|string $type, string $class, - string $parentId = null, + ?string $parentId = null, ): array { $resource = new ResourceIdentifier($id, $type, $parentId); $transformer = $this->transformerFactory->createFromModel($class);