From b7265fd74c39e11eda3a97a15840ac0e9552112b Mon Sep 17 00:00:00 2001
From: Steve Boyd <emteknetnz@gmail.com>
Date: Wed, 4 Dec 2024 18:26:03 +1300
Subject: [PATCH] Make nullable parameters explicity nullable for PHP 8.4

---
 src/symfony/src/Exception/HttpNotImplementedException.php     | 2 +-
 src/symfony/src/Routing/Loader.php                            | 4 ++--
 src/symfony/src/Security/Handler/DefaultFailureHandler.php    | 2 +-
 src/symfony/src/Security/Handler/FailureHandler.php           | 2 +-
 src/symfony/src/Service/DefaultFailureHandler.php             | 2 +-
 .../src/AuthenticationExtensions/ExtensionOutputError.php     | 2 +-
 .../src/Denormalizer/AttestationObjectDenormalizer.php        | 4 ++--
 .../src/Denormalizer/AttestationStatementDenormalizer.php     | 4 ++--
 .../src/Denormalizer/AuthenticationExtensionsDenormalizer.php | 4 ++--
 .../AuthenticatorAssertionResponseDenormalizer.php            | 4 ++--
 .../AuthenticatorAttestationResponseDenormalizer.php          | 4 ++--
 .../src/Denormalizer/AuthenticatorDataDenormalizer.php        | 4 ++--
 .../src/Denormalizer/AuthenticatorResponseDenormalizer.php    | 4 ++--
 .../src/Denormalizer/CollectedClientDataDenormalizer.php      | 4 ++--
 .../src/Denormalizer/ExtensionDescriptorDenormalizer.php      | 4 ++--
 .../src/Denormalizer/PublicKeyCredentialDenormalizer.php      | 4 ++--
 .../Denormalizer/PublicKeyCredentialOptionsDenormalizer.php   | 4 ++--
 .../PublicKeyCredentialParametersDenormalizer.php             | 4 ++--
 .../Denormalizer/PublicKeyCredentialSourceDenormalizer.php    | 4 ++--
 .../PublicKeyCredentialUserEntityDenormalizer.php             | 4 ++--
 src/webauthn/src/Denormalizer/TrustPathDenormalizer.php       | 4 ++--
 src/webauthn/src/MetadataService/Psr18HttpClient.php          | 4 ++--
 tests/symfony/functional/FailureHandler.php                   | 2 +-
 23 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/src/symfony/src/Exception/HttpNotImplementedException.php b/src/symfony/src/Exception/HttpNotImplementedException.php
index 1684a691c..75df25fe1 100644
--- a/src/symfony/src/Exception/HttpNotImplementedException.php
+++ b/src/symfony/src/Exception/HttpNotImplementedException.php
@@ -12,7 +12,7 @@ class HttpNotImplementedException extends HttpException
     /**
      * @param array<string, mixed> $headers
      */
-    public function __construct(string $message = '', Throwable $previous = null, int $code = 0, array $headers = [])
+    public function __construct(string $message = '', ?Throwable $previous = null, int $code = 0, array $headers = [])
     {
         parent::__construct(501, $message, $previous, $headers, $code);
     }
diff --git a/src/symfony/src/Routing/Loader.php b/src/symfony/src/Routing/Loader.php
index 8baa6c22c..8c78dfd85 100644
--- a/src/symfony/src/Routing/Loader.php
+++ b/src/symfony/src/Routing/Loader.php
@@ -31,12 +31,12 @@ public function add(string $pattern, ?string $host, string $name, string $method
     /**
      * @noRector
      */
-    public function load(mixed $resource, string $type = null): RouteCollection
+    public function load(mixed $resource, ?string $type = null): RouteCollection
     {
         return $this->routes;
     }
 
-    public function supports(mixed $resource, string $type = null): bool
+    public function supports(mixed $resource, ?string $type = null): bool
     {
         return $type === 'webauthn';
     }
diff --git a/src/symfony/src/Security/Handler/DefaultFailureHandler.php b/src/symfony/src/Security/Handler/DefaultFailureHandler.php
index 14bcf6526..52050b335 100644
--- a/src/symfony/src/Security/Handler/DefaultFailureHandler.php
+++ b/src/symfony/src/Security/Handler/DefaultFailureHandler.php
@@ -13,7 +13,7 @@
 
 final class DefaultFailureHandler implements FailureHandler, AuthenticationFailureHandlerInterface
 {
-    public function onFailure(Request $request, Throwable $exception = null): Response
+    public function onFailure(Request $request, ?Throwable $exception = null): Response
     {
         $data = [
             'status' => 'error',
diff --git a/src/symfony/src/Security/Handler/FailureHandler.php b/src/symfony/src/Security/Handler/FailureHandler.php
index 2b4144736..85b23113d 100644
--- a/src/symfony/src/Security/Handler/FailureHandler.php
+++ b/src/symfony/src/Security/Handler/FailureHandler.php
@@ -10,5 +10,5 @@
 
 interface FailureHandler
 {
-    public function onFailure(Request $request, Throwable $exception = null): Response;
+    public function onFailure(Request $request, ?Throwable $exception = null): Response;
 }
diff --git a/src/symfony/src/Service/DefaultFailureHandler.php b/src/symfony/src/Service/DefaultFailureHandler.php
index 630c2083b..9122e0155 100644
--- a/src/symfony/src/Service/DefaultFailureHandler.php
+++ b/src/symfony/src/Service/DefaultFailureHandler.php
@@ -12,7 +12,7 @@
 
 final class DefaultFailureHandler implements FailureHandler
 {
-    public function onFailure(Request $request, Throwable $exception = null): Response
+    public function onFailure(Request $request, ?Throwable $exception = null): Response
     {
         $data = [
             'status' => 'error',
diff --git a/src/webauthn/src/AuthenticationExtensions/ExtensionOutputError.php b/src/webauthn/src/AuthenticationExtensions/ExtensionOutputError.php
index 9adcc706f..9310befa5 100644
--- a/src/webauthn/src/AuthenticationExtensions/ExtensionOutputError.php
+++ b/src/webauthn/src/AuthenticationExtensions/ExtensionOutputError.php
@@ -13,7 +13,7 @@ public function __construct(
         public readonly AuthenticationExtension $authenticationExtension,
         string $message = '',
         int $code = 0,
-        Throwable $previous = null
+        ?Throwable $previous = null
     ) {
         parent::__construct($message, $code, $previous);
     }
diff --git a/src/webauthn/src/Denormalizer/AttestationObjectDenormalizer.php b/src/webauthn/src/Denormalizer/AttestationObjectDenormalizer.php
index dfd4519b7..4eaeb917e 100644
--- a/src/webauthn/src/Denormalizer/AttestationObjectDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/AttestationObjectDenormalizer.php
@@ -19,7 +19,7 @@ final class AttestationObjectDenormalizer implements DenormalizerInterface, Deno
 {
     use DenormalizerAwareTrait;
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         $stream = new StringStream($data);
         $parsed = Decoder::create()->decode($stream);
@@ -46,7 +46,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         );
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === AttestationObject::class;
     }
diff --git a/src/webauthn/src/Denormalizer/AttestationStatementDenormalizer.php b/src/webauthn/src/Denormalizer/AttestationStatementDenormalizer.php
index fea020bce..61f8bf751 100644
--- a/src/webauthn/src/Denormalizer/AttestationStatementDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/AttestationStatementDenormalizer.php
@@ -15,14 +15,14 @@ public function __construct(
     ) {
     }
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         $attestationStatementSupport = $this->attestationStatementSupportManager->get($data['fmt']);
 
         return $attestationStatementSupport->load($data);
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === AttestationStatement::class;
     }
diff --git a/src/webauthn/src/Denormalizer/AuthenticationExtensionsDenormalizer.php b/src/webauthn/src/Denormalizer/AuthenticationExtensionsDenormalizer.php
index e5bacefda..ce126e7a7 100644
--- a/src/webauthn/src/Denormalizer/AuthenticationExtensionsDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/AuthenticationExtensionsDenormalizer.php
@@ -17,7 +17,7 @@
 
 final class AuthenticationExtensionsDenormalizer implements DenormalizerInterface, NormalizerInterface
 {
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         if ($data instanceof AuthenticationExtensions) {
             return AuthenticationExtensions::create($data->extensions);
@@ -33,7 +33,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         return AuthenticationExtensions::create($data);
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return in_array(
             $type,
diff --git a/src/webauthn/src/Denormalizer/AuthenticatorAssertionResponseDenormalizer.php b/src/webauthn/src/Denormalizer/AuthenticatorAssertionResponseDenormalizer.php
index 613331c7a..4b2432e00 100644
--- a/src/webauthn/src/Denormalizer/AuthenticatorAssertionResponseDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/AuthenticatorAssertionResponseDenormalizer.php
@@ -18,7 +18,7 @@ final class AuthenticatorAssertionResponseDenormalizer implements DenormalizerIn
 {
     use DenormalizerAwareTrait;
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         $data['authenticatorData'] = Base64::decode($data['authenticatorData']);
         $data['signature'] = Base64::decode($data['signature']);
@@ -42,7 +42,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         );
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === AuthenticatorAssertionResponse::class;
     }
diff --git a/src/webauthn/src/Denormalizer/AuthenticatorAttestationResponseDenormalizer.php b/src/webauthn/src/Denormalizer/AuthenticatorAttestationResponseDenormalizer.php
index 5f6569dc7..d59303cac 100644
--- a/src/webauthn/src/Denormalizer/AuthenticatorAttestationResponseDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/AuthenticatorAttestationResponseDenormalizer.php
@@ -17,7 +17,7 @@ final class AuthenticatorAttestationResponseDenormalizer implements Denormalizer
 {
     use DenormalizerAwareTrait;
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         $data['clientDataJSON'] = Base64UrlSafe::decodeNoPadding($data['clientDataJSON']);
         $data['attestationObject'] = Base64::decode($data['attestationObject']);
@@ -42,7 +42,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         );
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === AuthenticatorAttestationResponse::class;
     }
diff --git a/src/webauthn/src/Denormalizer/AuthenticatorDataDenormalizer.php b/src/webauthn/src/Denormalizer/AuthenticatorDataDenormalizer.php
index f13450d0d..134b6bed0 100644
--- a/src/webauthn/src/Denormalizer/AuthenticatorDataDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/AuthenticatorDataDenormalizer.php
@@ -35,7 +35,7 @@ public function __construct()
         $this->decoder = Decoder::create();
     }
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         $authData = $this->fixIncorrectEdDSAKey($data);
         $authDataStream = new StringStream($authData);
@@ -87,7 +87,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         );
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === AuthenticatorData::class;
     }
diff --git a/src/webauthn/src/Denormalizer/AuthenticatorResponseDenormalizer.php b/src/webauthn/src/Denormalizer/AuthenticatorResponseDenormalizer.php
index 6a47309d5..8ab3aaef8 100644
--- a/src/webauthn/src/Denormalizer/AuthenticatorResponseDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/AuthenticatorResponseDenormalizer.php
@@ -17,7 +17,7 @@ final class AuthenticatorResponseDenormalizer implements DenormalizerInterface,
 {
     use DenormalizerAwareTrait;
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         $realType = match (true) {
             array_key_exists('attestationObject', $data) => AuthenticatorAttestationResponse::class,
@@ -28,7 +28,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         return $this->denormalizer->denormalize($data, $realType, $format, $context);
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === AuthenticatorResponse::class;
     }
diff --git a/src/webauthn/src/Denormalizer/CollectedClientDataDenormalizer.php b/src/webauthn/src/Denormalizer/CollectedClientDataDenormalizer.php
index e9e5264cd..ac47524ae 100644
--- a/src/webauthn/src/Denormalizer/CollectedClientDataDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/CollectedClientDataDenormalizer.php
@@ -14,12 +14,12 @@ final class CollectedClientDataDenormalizer implements DenormalizerInterface, De
 {
     use DenormalizerAwareTrait;
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         return CollectedClientData::create($data, json_decode($data, true, flags: JSON_THROW_ON_ERROR));
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === CollectedClientData::class;
     }
diff --git a/src/webauthn/src/Denormalizer/ExtensionDescriptorDenormalizer.php b/src/webauthn/src/Denormalizer/ExtensionDescriptorDenormalizer.php
index 4109ffb44..4d69b42a5 100644
--- a/src/webauthn/src/Denormalizer/ExtensionDescriptorDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/ExtensionDescriptorDenormalizer.php
@@ -19,7 +19,7 @@ class ExtensionDescriptorDenormalizer implements DenormalizerInterface, Denormal
 
     private const ALREADY_CALLED = 'EXTENSION_DESCRIPTOR_PREPROCESS_ALREADY_CALLED';
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         if (array_key_exists('fail_if_unknown', $data)) {
             $data['failIfUnknown'] = $data['fail_if_unknown'];
@@ -31,7 +31,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         return $this->denormalizer->denormalize($data, $type, $format, $context);
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         if ($context[self::ALREADY_CALLED] ?? false) {
             return false;
diff --git a/src/webauthn/src/Denormalizer/PublicKeyCredentialDenormalizer.php b/src/webauthn/src/Denormalizer/PublicKeyCredentialDenormalizer.php
index 33899b707..f1213ca4f 100644
--- a/src/webauthn/src/Denormalizer/PublicKeyCredentialDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialDenormalizer.php
@@ -18,7 +18,7 @@ final class PublicKeyCredentialDenormalizer implements DenormalizerInterface, De
 {
     use DenormalizerAwareTrait;
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         if (! array_key_exists('id', $data)) {
             return $data;
@@ -36,7 +36,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         );
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === PublicKeyCredential::class;
     }
diff --git a/src/webauthn/src/Denormalizer/PublicKeyCredentialOptionsDenormalizer.php b/src/webauthn/src/Denormalizer/PublicKeyCredentialOptionsDenormalizer.php
index 1b59091d5..2007d518c 100644
--- a/src/webauthn/src/Denormalizer/PublicKeyCredentialOptionsDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialOptionsDenormalizer.php
@@ -29,7 +29,7 @@ final class PublicKeyCredentialOptionsDenormalizer implements DenormalizerInterf
     use DenormalizerAwareTrait;
     use NormalizerAwareTrait;
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         if (array_key_exists('challenge', $data)) {
             $data['challenge'] = Base64UrlSafe::decodeNoPadding($data['challenge']);
@@ -103,7 +103,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         throw new BadMethodCallException('Unsupported type');
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return in_array(
             $type,
diff --git a/src/webauthn/src/Denormalizer/PublicKeyCredentialParametersDenormalizer.php b/src/webauthn/src/Denormalizer/PublicKeyCredentialParametersDenormalizer.php
index b5d640688..a35062a1e 100644
--- a/src/webauthn/src/Denormalizer/PublicKeyCredentialParametersDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialParametersDenormalizer.php
@@ -11,7 +11,7 @@
 
 final class PublicKeyCredentialParametersDenormalizer implements DenormalizerInterface
 {
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         if (! array_key_exists('type', $data) || ! array_key_exists('alg', $data)) {
             throw new InvalidDataException($data, 'Missing type or alg');
@@ -20,7 +20,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         return PublicKeyCredentialParameters::create($data['type'], $data['alg']);
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === PublicKeyCredentialParameters::class;
     }
diff --git a/src/webauthn/src/Denormalizer/PublicKeyCredentialSourceDenormalizer.php b/src/webauthn/src/Denormalizer/PublicKeyCredentialSourceDenormalizer.php
index bf8a5ae3d..9d8633577 100644
--- a/src/webauthn/src/Denormalizer/PublicKeyCredentialSourceDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialSourceDenormalizer.php
@@ -24,7 +24,7 @@ final class PublicKeyCredentialSourceDenormalizer implements DenormalizerInterfa
     use NormalizerAwareTrait;
     use DenormalizerAwareTrait;
 
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         $keys = ['publicKeyCredentialId', 'credentialPublicKey', 'userHandle'];
         foreach ($keys as $key) {
@@ -49,7 +49,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         );
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === PublicKeyCredentialSource::class;
     }
diff --git a/src/webauthn/src/Denormalizer/PublicKeyCredentialUserEntityDenormalizer.php b/src/webauthn/src/Denormalizer/PublicKeyCredentialUserEntityDenormalizer.php
index 275b2548a..3c5e300bd 100644
--- a/src/webauthn/src/Denormalizer/PublicKeyCredentialUserEntityDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialUserEntityDenormalizer.php
@@ -14,7 +14,7 @@
 
 final class PublicKeyCredentialUserEntityDenormalizer implements DenormalizerInterface, NormalizerInterface
 {
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         if (! array_key_exists('id', $data)) {
             return $data;
@@ -29,7 +29,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         );
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === PublicKeyCredentialUserEntity::class;
     }
diff --git a/src/webauthn/src/Denormalizer/TrustPathDenormalizer.php b/src/webauthn/src/Denormalizer/TrustPathDenormalizer.php
index 741dbcd83..9eb2508f4 100644
--- a/src/webauthn/src/Denormalizer/TrustPathDenormalizer.php
+++ b/src/webauthn/src/Denormalizer/TrustPathDenormalizer.php
@@ -16,7 +16,7 @@
 
 final class TrustPathDenormalizer implements DenormalizerInterface, NormalizerInterface
 {
-    public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
+    public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
     {
         return match (true) {
             array_key_exists('ecdaaKeyId', $data) => new EcdaaKeyIdTrustPath($data),
@@ -26,7 +26,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
         };
     }
 
-    public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
+    public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
     {
         return $type === TrustPath::class;
     }
diff --git a/src/webauthn/src/MetadataService/Psr18HttpClient.php b/src/webauthn/src/MetadataService/Psr18HttpClient.php
index 1f0b6f718..c296bb1f8 100644
--- a/src/webauthn/src/MetadataService/Psr18HttpClient.php
+++ b/src/webauthn/src/MetadataService/Psr18HttpClient.php
@@ -54,7 +54,7 @@ public function request(string $method, string $url, array $options = []): Respo
     /**
      * @param ResponseInterface|iterable<array-key, ResponseInterface> $responses
      */
-    public function stream(iterable|ResponseInterface $responses, float $timeout = null): ResponseStreamInterface
+    public function stream(iterable|ResponseInterface $responses, ?float $timeout = null): ResponseStreamInterface
     {
         throw new LogicException('Not implemented');
     }
@@ -119,7 +119,7 @@ public function cancel(): void
                 // noop
             }
 
-            public function getInfo(string $type = null): mixed
+            public function getInfo(?string $type = null): mixed
             {
                 return null;
             }
diff --git a/tests/symfony/functional/FailureHandler.php b/tests/symfony/functional/FailureHandler.php
index 73207860e..ad793b59f 100644
--- a/tests/symfony/functional/FailureHandler.php
+++ b/tests/symfony/functional/FailureHandler.php
@@ -19,7 +19,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
         return $this->onFailure($request, $exception);
     }
 
-    public function onFailure(Request $request, Throwable $exception = null): Response
+    public function onFailure(Request $request, ?Throwable $exception = null): Response
     {
         $data = [
             'status' => 'error',