diff --git a/src/Entity/BlockedEmailAddressHash.php b/src/Entity/BlockedEmailAddressHash.php index dda4274..5847f24 100644 --- a/src/Entity/BlockedEmailAddressHash.php +++ b/src/Entity/BlockedEmailAddressHash.php @@ -18,12 +18,12 @@ class BlockedEmailAddressHash implements BlockedEmailAddressHashInterface public static function fromEmailAddress( EmailAddress $emailAddress, - DateTimeImmutable $blockDate = null + ?DateTimeImmutable $blockDate = null ): BlockedEmailAddressHashInterface { return new self($emailAddress->getHash(), $blockDate); } - public function __construct(string $hash, DateTimeImmutable $blockDate = null) + public function __construct(string $hash, ?DateTimeImmutable $blockDate = null) { $this->hash = $hash; $this->blockDate = $blockDate ?? new DateTimeImmutable(); diff --git a/src/Entity/BlockedEmailAddressHashInterface.php b/src/Entity/BlockedEmailAddressHashInterface.php index b62ba20..4e06a5b 100644 --- a/src/Entity/BlockedEmailAddressHashInterface.php +++ b/src/Entity/BlockedEmailAddressHashInterface.php @@ -7,7 +7,7 @@ interface BlockedEmailAddressHashInterface { - public static function fromEmailAddress(EmailAddress $emailAddress, DateTimeImmutable $blockDate = null): self; + public static function fromEmailAddress(EmailAddress $emailAddress, ?DateTimeImmutable $blockDate = null): self; public function getBlockedUntilDate(DateInterval $blockDuration): DateTimeImmutable; } diff --git a/src/Exception/EmailAddressCanNotBeHashedWithoutSecretException.php b/src/Exception/EmailAddressCanNotBeHashedWithoutSecretException.php index 85b8ec6..6be8ac8 100644 --- a/src/Exception/EmailAddressCanNotBeHashedWithoutSecretException.php +++ b/src/Exception/EmailAddressCanNotBeHashedWithoutSecretException.php @@ -7,7 +7,7 @@ class EmailAddressCanNotBeHashedWithoutSecretException extends WebfactoryNewsletterRegistrationException { - public function __construct(EmailAddress $emailAddress, $code = 0, Throwable $previous = null) + public function __construct(EmailAddress $emailAddress, $code = 0, ?Throwable $previous = null) { parent::__construct( 'The email address "'.$emailAddress->getEmailAddress().'" could not be hashed as this email ' diff --git a/src/Exception/EmailAddressDoesNotMatchHashOfPendingOptInException.php b/src/Exception/EmailAddressDoesNotMatchHashOfPendingOptInException.php index b381261..5b285a7 100644 --- a/src/Exception/EmailAddressDoesNotMatchHashOfPendingOptInException.php +++ b/src/Exception/EmailAddressDoesNotMatchHashOfPendingOptInException.php @@ -12,7 +12,7 @@ public function __construct( EmailAddress $emailAddress, PendingOptInInterface $pendingOptIn, $code = 0, - Throwable $previous = null + ?Throwable $previous = null ) { parent::__construct( 'The email address "'.$emailAddress->getEmailAddress().'" does not correspond to the hash of the ' diff --git a/src/Exception/PendingOptInClassCouldNotBeDeterminedException.php b/src/Exception/PendingOptInClassCouldNotBeDeterminedException.php index 509dd0c..1007aba 100644 --- a/src/Exception/PendingOptInClassCouldNotBeDeterminedException.php +++ b/src/Exception/PendingOptInClassCouldNotBeDeterminedException.php @@ -8,7 +8,7 @@ class PendingOptInClassCouldNotBeDeterminedException extends WebfactoryNewsletterRegistrationException { - public function __construct($code = 0, Throwable $previous = null) + public function __construct($code = 0, ?Throwable $previous = null) { parent::__construct( 'We were unable to determine your '.RecipientInterface::class.' implementation. Consider replacing' diff --git a/src/Exception/PendingOptInIsOutdatedException.php b/src/Exception/PendingOptInIsOutdatedException.php index 843baa2..96fa1ee 100644 --- a/src/Exception/PendingOptInIsOutdatedException.php +++ b/src/Exception/PendingOptInIsOutdatedException.php @@ -7,7 +7,7 @@ class PendingOptInIsOutdatedException extends WebfactoryNewsletterRegistrationException { - public function __construct(PendingOptInInterface $pendingOptIn, $code = 0, Throwable $previous = null) + public function __construct(PendingOptInInterface $pendingOptIn, $code = 0, ?Throwable $previous = null) { parent::__construct( 'The PendingOptIn with uuid '.$pendingOptIn->getUuid().' is outdated and can no longer be ' diff --git a/src/Exception/RecipientClassCouldNotBeDeterminedException.php b/src/Exception/RecipientClassCouldNotBeDeterminedException.php index b48318d..39d4f13 100644 --- a/src/Exception/RecipientClassCouldNotBeDeterminedException.php +++ b/src/Exception/RecipientClassCouldNotBeDeterminedException.php @@ -8,7 +8,7 @@ class RecipientClassCouldNotBeDeterminedException extends WebfactoryNewsletterRegistrationException { - public function __construct($code = 0, Throwable $previous = null) + public function __construct($code = 0, ?Throwable $previous = null) { parent::__construct( 'We were unable to determine your '.RecipientInterface::class.' implementation. Consider replacing' diff --git a/src/StartRegistration/HoneypotType.php b/src/StartRegistration/HoneypotType.php index 77a67ba..f31565e 100644 --- a/src/StartRegistration/HoneypotType.php +++ b/src/StartRegistration/HoneypotType.php @@ -26,7 +26,7 @@ class HoneypotType extends AbstractType protected TranslatorInterface $translator; protected LoggerInterface $logger; - public function __construct(TranslatorInterface $translator, LoggerInterface $logger = null) + public function __construct(TranslatorInterface $translator, ?LoggerInterface $logger = null) { $this->translator = $translator; $this->logger = $logger ?: new NullLogger();