diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index eac003ae2..cba23e4a6 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -57,6 +57,7 @@ jobs: php-version: - "8.2" - "8.3" + - "8.4" dependencies: - "lowest" - "highest" 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 $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 6a1d0d7d8..f731e12f0 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 541308b69..1b5c34a7d 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 4bafad0b3..07369f235 100644 --- a/src/webauthn/src/Denormalizer/AuthenticationExtensionsDenormalizer.php +++ b/src/webauthn/src/Denormalizer/AuthenticationExtensionsDenormalizer.php @@ -14,7 +14,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); @@ -30,7 +30,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 $type === AuthenticationExtensions::class; } 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 fc0110dcd..4ba257191 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 8585432ab..fe9c78ae6 100644 --- a/src/webauthn/src/Denormalizer/ExtensionDescriptorDenormalizer.php +++ b/src/webauthn/src/Denormalizer/ExtensionDescriptorDenormalizer.php @@ -10,7 +10,7 @@ final class ExtensionDescriptorDenormalizer 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('fail_if_unknown', $data)) { $data['failIfUnknown'] = $data['fail_if_unknown']; @@ -20,7 +20,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar return ExtensionDescriptor::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 $type === ExtensionDescriptor::class; } diff --git a/src/webauthn/src/Denormalizer/PublicKeyCredentialDenormalizer.php b/src/webauthn/src/Denormalizer/PublicKeyCredentialDenormalizer.php index 066b5a557..d46f00086 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; @@ -35,7 +35,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 7a1c207a3..ddf611f66 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 2e3148457..414b85c0d 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; @@ -24,7 +24,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar return PublicKeyCredentialUserEntity::create($data['name'], $data['id'], $data['displayName']); } - 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 0531ca044..fbea66b1d 100644 --- a/src/webauthn/src/Denormalizer/TrustPathDenormalizer.php +++ b/src/webauthn/src/Denormalizer/TrustPathDenormalizer.php @@ -15,7 +15,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('x5c', $data) => CertificateTrustPath::create($data), @@ -24,7 +24,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 $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/src/webauthn/src/MetadataService/Service/FidoAllianceCompliantMetadataService.php b/src/webauthn/src/MetadataService/Service/FidoAllianceCompliantMetadataService.php index f01cc1217..fc27ebe0c 100644 --- a/src/webauthn/src/MetadataService/Service/FidoAllianceCompliantMetadataService.php +++ b/src/webauthn/src/MetadataService/Service/FidoAllianceCompliantMetadataService.php @@ -57,7 +57,7 @@ public function __construct( private readonly array $additionalHeaderParameters = [], private readonly ?CertificateChainValidator $certificateChainValidator = null, private readonly ?string $rootCertificateUri = null, - SerializerInterface $serializer = null, + ?SerializerInterface $serializer = null, ) { $this->serializer = $serializer ?? (new WebauthnSerializerFactory( AttestationStatementSupportManager::create() 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',