From 64690c405954d5017b3fff451cb3448ad6419adb Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Sat, 4 Jan 2025 10:36:42 +0100 Subject: [PATCH] Add `sprintf` utility usage across multiple classes Introduced `sprintf` function in various classes to improve code consistency and formatting operations. Additionally, minor adjustments were made to PHP versions in workflows and the removal of unnecessary PHPUnit configurations. --- .github/workflows/integrate.yml | 6 ++--- composer.json | 1 - phpstan-baseline.neon | 25 +++++++++++++++++++ phpunit.xml.dist | 3 --- .../AttestationResponseController.php | 1 + .../ProfileBasedCreationOptionsBuilder.php | 1 + .../ProfileBasedRequestOptionsBuilder.php | 1 + .../Compiler/DynamicRouteCompilerPass.php | 1 + .../Factory/Security/WebauthnFactory.php | 1 + .../DependencyInjection/WebauthnExtension.php | 1 + ...cKeyCredentialDescriptorCollectionType.php | 1 + ...AssertionResponseValidationFailedEvent.php | 1 + ...ertionResponseValidationSucceededEvent.php | 1 + ...testationResponseValidationFailedEvent.php | 1 + ...tationResponseValidationSucceededEvent.php | 1 + .../DoctrineCredentialSourceRepository.php | 1 + src/symfony/src/Routing/Loader.php | 1 + .../Authenticator/WebauthnAuthenticator.php | 1 + .../src/Security/Storage/CacheStorage.php | 1 + ...uthenticatorAssertionResponseValidator.php | 1 + ...henticatorAttestationResponseValidator.php | 1 + ...licKeyCredentialCreationOptionsFactory.php | 1 + ...blicKeyCredentialRequestOptionsFactory.php | 1 + .../AndroidKeyAttestationStatementSupport.php | 1 + ...idSafetyNetAttestationStatementSupport.php | 1 + .../AttestationStatement.php | 1 + .../AttestationStatementSupportManager.php | 1 + .../FidoU2FAttestationStatementSupport.php | 1 + .../TPMAttestationStatementSupport.php | 1 + .../AuthenticationExtensions.php | 1 + ...uthenticatorAssertionResponseValidator.php | 1 + ...henticatorAttestationResponseValidator.php | 1 + .../src/CeremonyStep/CheckAlgorithm.php | 3 ++- .../CeremonyStep/CheckMetadataStatement.php | 1 + .../src/CeremonyStep/CheckSignature.php | 2 +- .../WebauthnAuthenticationCollector.php | 1 + src/webauthn/src/CollectedClientData.php | 1 + .../AttestationObjectDenormalizer.php | 8 ++++-- .../AttestationStatementDenormalizer.php | 8 ++++-- .../AuthenticationExtensionsDenormalizer.php | 8 ++++-- ...enticatorAssertionResponseDenormalizer.php | 8 ++++-- ...ticatorAttestationResponseDenormalizer.php | 8 ++++-- .../AuthenticatorDataDenormalizer.php | 8 ++++-- .../AuthenticatorResponseDenormalizer.php | 8 ++++-- .../CollectedClientDataDenormalizer.php | 8 ++++-- .../ExtensionDescriptorDenormalizer.php | 8 ++++-- .../PublicKeyCredentialDenormalizer.php | 8 ++++-- ...PublicKeyCredentialOptionsDenormalizer.php | 8 ++++-- ...licKeyCredentialParametersDenormalizer.php | 8 ++++-- .../PublicKeyCredentialSourceDenormalizer.php | 8 ++++-- ...licKeyCredentialUserEntityDenormalizer.php | 8 ++++-- .../Denormalizer/TrustPathDenormalizer.php | 8 ++++-- .../WebauthnSerializerFactory.php | 1 + ...AssertionResponseValidationFailedEvent.php | 1 + ...ertionResponseValidationSucceededEvent.php | 1 + ...testationResponseValidationFailedEvent.php | 1 + ...tationResponseValidationSucceededEvent.php | 1 + .../PhpCertificateChainValidator.php | 1 + .../Service/MetadataBLOBPayload.php | 1 + .../DisplayPNGCharacteristicsDescriptor.php | 1 + .../Statement/EcdaaTrustAnchor.php | 1 + .../Statement/MetadataStatement.php | 1 + .../Statement/PatternAccuracyDescriptor.php | 1 + .../Statement/RgbPaletteEntry.php | 1 + .../Statement/StatusReport.php | 1 + .../VerificationMethodDescriptor.php | 1 + .../src/MetadataService/Statement/Version.php | 1 + src/webauthn/src/PublicKeyCredential.php | 1 + .../src/PublicKeyCredentialLoader.php | 1 + .../src/PublicKeyCredentialSource.php | 1 + src/webauthn/src/StringStream.php | 1 + .../src/TokenBinding/TokenBinding.php | 1 + tests/framework/ComposerJsonTest.php | 1 + tests/library/AbstractTestCase.php | 1 + .../AuthenticationExtensionsClientTest.php | 4 +-- .../symfony/functional/MockClientCallback.php | 1 + .../symfony/functional/SingleFileService.php | 1 + tests/symfony/functional/UserProvider.php | 1 + 78 files changed, 178 insertions(+), 42 deletions(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 47cd0538c..855859a69 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -59,9 +59,7 @@ jobs: - "8.1" - "8.2" - "8.3" - dependencies: - - "lowest" - - "highest" + - "8.4" runs-on: ${{ matrix.operating-system }} steps: - name: "Set up PHP" @@ -98,7 +96,7 @@ jobs: operating-system: - "ubuntu-latest" php-version: - - "8.2" + - "8.3" runs-on: ${{ matrix.operating-system }} steps: - name: "Set up PHP" diff --git a/composer.json b/composer.json index 381479128..06ae061a5 100644 --- a/composer.json +++ b/composer.json @@ -120,7 +120,6 @@ "symfony/filesystem": "^6.4|^7.0", "symfony/finder": "^6.4|^7.0", "symfony/monolog-bundle": "^3.8", - "symfony/phpunit-bridge": "^6.4|^7.0", "symfony/var-dumper": "^6.4|^7.0", "symfony/yaml": "^6.4|^7.0", "symplify/easy-coding-standard": "^12.0" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 58b1fac65..0365e5a47 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -2706,6 +2706,11 @@ parameters: count: 1 path: src/webauthn/src/MetadataService/Service/DistantResourceMetadataService.php + - + message: "#^Property Webauthn\\\\MetadataService\\\\Service\\\\DistantResourceMetadataService\\:\\:\\$serializer \\(Symfony\\\\Component\\\\Serializer\\\\SerializerInterface\\|null\\) is never assigned null so it can be removed from the property type\\.$#" + count: 1 + path: src/webauthn/src/MetadataService/Service/DistantResourceMetadataService.php + - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" count: 1 @@ -2759,6 +2764,11 @@ parameters: count: 1 path: src/webauthn/src/MetadataService/Service/FidoAllianceCompliantMetadataService.php + - + message: "#^Property Webauthn\\\\MetadataService\\\\Service\\\\FidoAllianceCompliantMetadataService\\:\\:\\$serializer \\(Symfony\\\\Component\\\\Serializer\\\\SerializerInterface\\|null\\) is never assigned null so it can be removed from the property type\\.$#" + count: 1 + path: src/webauthn/src/MetadataService/Service/FidoAllianceCompliantMetadataService.php + - message: """ #^Call to deprecated method createFromString\\(\\) of class Webauthn\\\\MetadataService\\\\Statement\\\\MetadataStatement\\: @@ -2772,6 +2782,11 @@ parameters: count: 1 path: src/webauthn/src/MetadataService/Service/FolderResourceMetadataService.php + - + message: "#^Property Webauthn\\\\MetadataService\\\\Service\\\\FolderResourceMetadataService\\:\\:\\$serializer \\(Symfony\\\\Component\\\\Serializer\\\\SerializerInterface\\|null\\) is never assigned null so it can be removed from the property type\\.$#" + count: 1 + path: src/webauthn/src/MetadataService/Service/FolderResourceMetadataService.php + - message: """ #^Call to deprecated method createFromString\\(\\) of class Webauthn\\\\MetadataService\\\\Statement\\\\MetadataStatement\\: @@ -2780,6 +2795,11 @@ parameters: count: 1 path: src/webauthn/src/MetadataService/Service/JsonMetadataService.php + - + message: "#^Property Webauthn\\\\MetadataService\\\\Service\\\\JsonMetadataService\\:\\:\\$serializer \\(Symfony\\\\Component\\\\Serializer\\\\SerializerInterface\\|null\\) is never assigned null so it can be removed from the property type\\.$#" + count: 1 + path: src/webauthn/src/MetadataService/Service/JsonMetadataService.php + - message: """ #^Call to deprecated method createFromString\\(\\) of class Webauthn\\\\MetadataService\\\\Statement\\\\MetadataStatement\\: @@ -2798,6 +2818,11 @@ parameters: count: 1 path: src/webauthn/src/MetadataService/Service/LocalResourceMetadataService.php + - + message: "#^Property Webauthn\\\\MetadataService\\\\Service\\\\LocalResourceMetadataService\\:\\:\\$serializer \\(Symfony\\\\Component\\\\Serializer\\\\SerializerInterface\\|null\\) is never assigned null so it can be removed from the property type\\.$#" + count: 1 + path: src/webauthn/src/MetadataService/Service/LocalResourceMetadataService.php + - message: "#^Parameter \\#1 \\$data of static method Webauthn\\\\MetadataService\\\\Service\\\\MetadataBLOBPayloadEntry\\:\\:createFromArray\\(\\) expects array\\, mixed given\\.$#" count: 1 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ddc6030b1..7ae39ceac 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -18,9 +18,6 @@ - - - diff --git a/src/symfony/src/Controller/AttestationResponseController.php b/src/symfony/src/Controller/AttestationResponseController.php index 8877af0d9..b79a51c85 100644 --- a/src/symfony/src/Controller/AttestationResponseController.php +++ b/src/symfony/src/Controller/AttestationResponseController.php @@ -25,6 +25,7 @@ use Webauthn\PublicKeyCredentialLoader; use Webauthn\PublicKeyCredentialSourceRepository; use Webauthn\PublicKeyCredentialUserEntity; +use function sprintf; final class AttestationResponseController { diff --git a/src/symfony/src/CredentialOptionsBuilder/ProfileBasedCreationOptionsBuilder.php b/src/symfony/src/CredentialOptionsBuilder/ProfileBasedCreationOptionsBuilder.php index 7b9a10f8f..c3d41084c 100644 --- a/src/symfony/src/CredentialOptionsBuilder/ProfileBasedCreationOptionsBuilder.php +++ b/src/symfony/src/CredentialOptionsBuilder/ProfileBasedCreationOptionsBuilder.php @@ -22,6 +22,7 @@ use Webauthn\PublicKeyCredentialUserEntity; use function count; use function is_array; +use function sprintf; use const FILTER_VALIDATE_BOOLEAN; final class ProfileBasedCreationOptionsBuilder implements PublicKeyCredentialCreationOptionsBuilder diff --git a/src/symfony/src/CredentialOptionsBuilder/ProfileBasedRequestOptionsBuilder.php b/src/symfony/src/CredentialOptionsBuilder/ProfileBasedRequestOptionsBuilder.php index e0658324e..468276ca4 100644 --- a/src/symfony/src/CredentialOptionsBuilder/ProfileBasedRequestOptionsBuilder.php +++ b/src/symfony/src/CredentialOptionsBuilder/ProfileBasedRequestOptionsBuilder.php @@ -23,6 +23,7 @@ use Webauthn\PublicKeyCredentialUserEntity; use function count; use function is_array; +use function sprintf; final class ProfileBasedRequestOptionsBuilder implements PublicKeyCredentialRequestOptionsBuilder { diff --git a/src/symfony/src/DependencyInjection/Compiler/DynamicRouteCompilerPass.php b/src/symfony/src/DependencyInjection/Compiler/DynamicRouteCompilerPass.php index e2a4fede5..1f6db7c23 100644 --- a/src/symfony/src/DependencyInjection/Compiler/DynamicRouteCompilerPass.php +++ b/src/symfony/src/DependencyInjection/Compiler/DynamicRouteCompilerPass.php @@ -9,6 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Webauthn\Bundle\Routing\Loader; use function array_key_exists; +use function sprintf; final class DynamicRouteCompilerPass implements CompilerPassInterface { diff --git a/src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php b/src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php index 7daae1b1b..c8feb36d7 100644 --- a/src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php +++ b/src/symfony/src/DependencyInjection/Factory/Security/WebauthnFactory.php @@ -39,6 +39,7 @@ use Webauthn\FakeCredentialGenerator; use function array_key_exists; use function assert; +use function sprintf; final class WebauthnFactory implements FirewallListenerFactoryInterface, AuthenticatorFactoryInterface { diff --git a/src/symfony/src/DependencyInjection/WebauthnExtension.php b/src/symfony/src/DependencyInjection/WebauthnExtension.php index baee370d3..1a8cfa61e 100644 --- a/src/symfony/src/DependencyInjection/WebauthnExtension.php +++ b/src/symfony/src/DependencyInjection/WebauthnExtension.php @@ -57,6 +57,7 @@ use function array_key_exists; use function count; use function is_array; +use function sprintf; final class WebauthnExtension extends Extension implements PrependExtensionInterface { diff --git a/src/symfony/src/Doctrine/Type/PublicKeyCredentialDescriptorCollectionType.php b/src/symfony/src/Doctrine/Type/PublicKeyCredentialDescriptorCollectionType.php index eb5c6ae5f..476d66e4d 100644 --- a/src/symfony/src/Doctrine/Type/PublicKeyCredentialDescriptorCollectionType.php +++ b/src/symfony/src/Doctrine/Type/PublicKeyCredentialDescriptorCollectionType.php @@ -8,6 +8,7 @@ use Doctrine\DBAL\Types\Type; use InvalidArgumentException; use function is_string; +use function sprintf; use const JSON_THROW_ON_ERROR; /** diff --git a/src/symfony/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php b/src/symfony/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php index b7e5c0dac..8bc49a81c 100644 --- a/src/symfony/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php +++ b/src/symfony/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php @@ -10,6 +10,7 @@ use Webauthn\Event\AuthenticatorAssertionResponseValidationFailedEvent as BaseAuthenticatorAssertionResponseValidationFailedEvent; use Webauthn\PublicKeyCredentialRequestOptions; use Webauthn\PublicKeyCredentialSource; +use function sprintf; /** * @deprecated since 4.3.0, use {@link \Webauthn\Event\AuthenticatorAssertionResponseValidationFailedEvent} instead. diff --git a/src/symfony/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.php b/src/symfony/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.php index 306522640..4c6adab47 100644 --- a/src/symfony/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.php +++ b/src/symfony/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.php @@ -9,6 +9,7 @@ use Webauthn\Event\AuthenticatorAssertionResponseValidationSucceededEvent as BaseAuthenticatorAssertionResponseValidationSucceededEvent; use Webauthn\PublicKeyCredentialRequestOptions; use Webauthn\PublicKeyCredentialSource; +use function sprintf; /** * @deprecated since 4.3.0, use {@link \Webauthn\Event\AuthenticatorAssertionResponseValidationSucceededEvent} instead. diff --git a/src/symfony/src/Event/AuthenticatorAttestationResponseValidationFailedEvent.php b/src/symfony/src/Event/AuthenticatorAttestationResponseValidationFailedEvent.php index 016f64e5b..787e4d917 100644 --- a/src/symfony/src/Event/AuthenticatorAttestationResponseValidationFailedEvent.php +++ b/src/symfony/src/Event/AuthenticatorAttestationResponseValidationFailedEvent.php @@ -9,6 +9,7 @@ use Webauthn\AuthenticatorAttestationResponse; use Webauthn\Event\AuthenticatorAttestationResponseValidationFailedEvent as BaseAuthenticatorAttestationResponseValidationFailedEvent; use Webauthn\PublicKeyCredentialCreationOptions; +use function sprintf; /** * @deprecated since 4.3.0, use {@link \Webauthn\Event\AuthenticatorAttestationResponseValidationFailedEvent} instead. diff --git a/src/symfony/src/Event/AuthenticatorAttestationResponseValidationSucceededEvent.php b/src/symfony/src/Event/AuthenticatorAttestationResponseValidationSucceededEvent.php index 0a1f15712..266bb388d 100644 --- a/src/symfony/src/Event/AuthenticatorAttestationResponseValidationSucceededEvent.php +++ b/src/symfony/src/Event/AuthenticatorAttestationResponseValidationSucceededEvent.php @@ -9,6 +9,7 @@ use Webauthn\Event\AuthenticatorAttestationResponseValidationSucceededEvent as BaseAuthenticatorAttestationResponseValidationSucceededEvent; use Webauthn\PublicKeyCredentialCreationOptions; use Webauthn\PublicKeyCredentialSource; +use function sprintf; /** * @deprecated since 4.3.0, use {@link \Webauthn\Event\AuthenticatorAttestationResponseValidationSucceededEvent} instead. diff --git a/src/symfony/src/Repository/DoctrineCredentialSourceRepository.php b/src/symfony/src/Repository/DoctrineCredentialSourceRepository.php index f64da34b5..d535e8940 100644 --- a/src/symfony/src/Repository/DoctrineCredentialSourceRepository.php +++ b/src/symfony/src/Repository/DoctrineCredentialSourceRepository.php @@ -9,6 +9,7 @@ use InvalidArgumentException; use Webauthn\PublicKeyCredentialSource; use Webauthn\PublicKeyCredentialUserEntity; +use function sprintf; /** * @template T of PublicKeyCredentialSource diff --git a/src/symfony/src/Routing/Loader.php b/src/symfony/src/Routing/Loader.php index 8c78dfd85..75efbd8b4 100644 --- a/src/symfony/src/Routing/Loader.php +++ b/src/symfony/src/Routing/Loader.php @@ -7,6 +7,7 @@ use Symfony\Component\Config\Loader\Loader as SymfonyLoader; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; +use function sprintf; class Loader extends SymfonyLoader { diff --git a/src/symfony/src/Security/Http/Authenticator/WebauthnAuthenticator.php b/src/symfony/src/Security/Http/Authenticator/WebauthnAuthenticator.php index 53862aad8..68baef656 100644 --- a/src/symfony/src/Security/Http/Authenticator/WebauthnAuthenticator.php +++ b/src/symfony/src/Security/Http/Authenticator/WebauthnAuthenticator.php @@ -44,6 +44,7 @@ use Webauthn\PublicKeyCredentialRequestOptions; use Webauthn\PublicKeyCredentialSourceRepository; use Webauthn\PublicKeyCredentialUserEntity; +use function sprintf; final class WebauthnAuthenticator implements AuthenticatorInterface, InteractiveAuthenticatorInterface, CanLogData { diff --git a/src/symfony/src/Security/Storage/CacheStorage.php b/src/symfony/src/Security/Storage/CacheStorage.php index 34a9d6c9a..8c3b7fa4d 100644 --- a/src/symfony/src/Security/Storage/CacheStorage.php +++ b/src/symfony/src/Security/Storage/CacheStorage.php @@ -6,6 +6,7 @@ use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +use function sprintf; final class CacheStorage implements OptionsStorage { diff --git a/src/symfony/src/Service/AuthenticatorAssertionResponseValidator.php b/src/symfony/src/Service/AuthenticatorAssertionResponseValidator.php index a74297c08..080903e9f 100644 --- a/src/symfony/src/Service/AuthenticatorAssertionResponseValidator.php +++ b/src/symfony/src/Service/AuthenticatorAssertionResponseValidator.php @@ -17,6 +17,7 @@ use Webauthn\PublicKeyCredentialRequestOptions; use Webauthn\PublicKeyCredentialSource; use Webauthn\TokenBinding\TokenBindingHandler; +use function sprintf; /** * @deprecated since 4.3.0. The class is deprecated and will be removed in 5.0.0. Please use "Webauthn\AuthenticatorAssertionResponseValidator" instead. diff --git a/src/symfony/src/Service/AuthenticatorAttestationResponseValidator.php b/src/symfony/src/Service/AuthenticatorAttestationResponseValidator.php index 866cca687..f0e6eef7d 100644 --- a/src/symfony/src/Service/AuthenticatorAttestationResponseValidator.php +++ b/src/symfony/src/Service/AuthenticatorAttestationResponseValidator.php @@ -17,6 +17,7 @@ use Webauthn\PublicKeyCredentialCreationOptions; use Webauthn\PublicKeyCredentialSource; use Webauthn\TokenBinding\TokenBindingHandler; +use function sprintf; /** * @deprecated since 4.3.0. The class is deprecated and will be removed in 5.0.0. Please use "Webauthn\BaseAuthenticatorAttestationResponseValidator" instead. diff --git a/src/symfony/src/Service/PublicKeyCredentialCreationOptionsFactory.php b/src/symfony/src/Service/PublicKeyCredentialCreationOptionsFactory.php index abc72e1ee..9e36e0cc7 100644 --- a/src/symfony/src/Service/PublicKeyCredentialCreationOptionsFactory.php +++ b/src/symfony/src/Service/PublicKeyCredentialCreationOptionsFactory.php @@ -22,6 +22,7 @@ use function gettype; use function is_int; use function is_string; +use function sprintf; final class PublicKeyCredentialCreationOptionsFactory implements CanDispatchEvents { diff --git a/src/symfony/src/Service/PublicKeyCredentialRequestOptionsFactory.php b/src/symfony/src/Service/PublicKeyCredentialRequestOptionsFactory.php index 9d2c5ecbc..72a2d2905 100644 --- a/src/symfony/src/Service/PublicKeyCredentialRequestOptionsFactory.php +++ b/src/symfony/src/Service/PublicKeyCredentialRequestOptionsFactory.php @@ -18,6 +18,7 @@ use function gettype; use function is_int; use function is_string; +use function sprintf; final class PublicKeyCredentialRequestOptionsFactory implements CanDispatchEvents { diff --git a/src/webauthn/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php b/src/webauthn/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php index eb54b7b40..002423545 100644 --- a/src/webauthn/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php +++ b/src/webauthn/src/AttestationStatement/AndroidKeyAttestationStatementSupport.php @@ -29,6 +29,7 @@ use function is_array; use function openssl_pkey_get_public; use function openssl_verify; +use function sprintf; final class AndroidKeyAttestationStatementSupport implements AttestationStatementSupport, CanDispatchEvents { diff --git a/src/webauthn/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php b/src/webauthn/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php index cd87757c3..d852ce517 100644 --- a/src/webauthn/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php +++ b/src/webauthn/src/AttestationStatement/AndroidSafetyNetAttestationStatementSupport.php @@ -41,6 +41,7 @@ use function is_array; use function is_int; use function is_string; +use function sprintf; use const JSON_THROW_ON_ERROR; /** diff --git a/src/webauthn/src/AttestationStatement/AttestationStatement.php b/src/webauthn/src/AttestationStatement/AttestationStatement.php index 5285de2eb..8f45491c0 100644 --- a/src/webauthn/src/AttestationStatement/AttestationStatement.php +++ b/src/webauthn/src/AttestationStatement/AttestationStatement.php @@ -9,6 +9,7 @@ use Webauthn\TrustPath\TrustPath; use Webauthn\TrustPath\TrustPathLoader; use function array_key_exists; +use function sprintf; class AttestationStatement implements JsonSerializable { diff --git a/src/webauthn/src/AttestationStatement/AttestationStatementSupportManager.php b/src/webauthn/src/AttestationStatement/AttestationStatementSupportManager.php index 089028810..7687d8d35 100644 --- a/src/webauthn/src/AttestationStatement/AttestationStatementSupportManager.php +++ b/src/webauthn/src/AttestationStatement/AttestationStatementSupportManager.php @@ -6,6 +6,7 @@ use Webauthn\Exception\InvalidDataException; use function array_key_exists; +use function sprintf; class AttestationStatementSupportManager { diff --git a/src/webauthn/src/AttestationStatement/FidoU2FAttestationStatementSupport.php b/src/webauthn/src/AttestationStatement/FidoU2FAttestationStatementSupport.php index db4bf3a12..c0d812b2f 100644 --- a/src/webauthn/src/AttestationStatement/FidoU2FAttestationStatementSupport.php +++ b/src/webauthn/src/AttestationStatement/FidoU2FAttestationStatementSupport.php @@ -24,6 +24,7 @@ use function is_array; use function openssl_pkey_get_public; use function openssl_verify; +use function sprintf; use const OPENSSL_ALGO_SHA256; final class FidoU2FAttestationStatementSupport implements AttestationStatementSupport, CanDispatchEvents diff --git a/src/webauthn/src/AttestationStatement/TPMAttestationStatementSupport.php b/src/webauthn/src/AttestationStatement/TPMAttestationStatementSupport.php index 71a60ca61..7f027ef83 100644 --- a/src/webauthn/src/AttestationStatement/TPMAttestationStatementSupport.php +++ b/src/webauthn/src/AttestationStatement/TPMAttestationStatementSupport.php @@ -36,6 +36,7 @@ use function is_array; use function is_int; use function openssl_verify; +use function sprintf; use function unpack; final class TPMAttestationStatementSupport implements AttestationStatementSupport, CanDispatchEvents diff --git a/src/webauthn/src/AuthenticationExtensions/AuthenticationExtensions.php b/src/webauthn/src/AuthenticationExtensions/AuthenticationExtensions.php index 2ef2bc65e..5315524e9 100644 --- a/src/webauthn/src/AuthenticationExtensions/AuthenticationExtensions.php +++ b/src/webauthn/src/AuthenticationExtensions/AuthenticationExtensions.php @@ -14,6 +14,7 @@ use function array_key_exists; use function count; use function is_string; +use function sprintf; use const COUNT_NORMAL; /** diff --git a/src/webauthn/src/AuthenticatorAssertionResponseValidator.php b/src/webauthn/src/AuthenticatorAssertionResponseValidator.php index fa433b211..d6923b724 100644 --- a/src/webauthn/src/AuthenticatorAssertionResponseValidator.php +++ b/src/webauthn/src/AuthenticatorAssertionResponseValidator.php @@ -22,6 +22,7 @@ use Webauthn\MetadataService\CanLogData; use Webauthn\TokenBinding\TokenBindingHandler; use function is_string; +use function sprintf; class AuthenticatorAssertionResponseValidator implements CanLogData, CanDispatchEvents { diff --git a/src/webauthn/src/AuthenticatorAttestationResponseValidator.php b/src/webauthn/src/AuthenticatorAttestationResponseValidator.php index 97d43402e..71fc82f6b 100644 --- a/src/webauthn/src/AuthenticatorAttestationResponseValidator.php +++ b/src/webauthn/src/AuthenticatorAttestationResponseValidator.php @@ -24,6 +24,7 @@ use Webauthn\MetadataService\StatusReportRepository; use Webauthn\TokenBinding\TokenBindingHandler; use function is_string; +use function sprintf; class AuthenticatorAttestationResponseValidator implements CanLogData, CanDispatchEvents { diff --git a/src/webauthn/src/CeremonyStep/CheckAlgorithm.php b/src/webauthn/src/CeremonyStep/CheckAlgorithm.php index 9b5e39b22..74a221e14 100644 --- a/src/webauthn/src/CeremonyStep/CheckAlgorithm.php +++ b/src/webauthn/src/CeremonyStep/CheckAlgorithm.php @@ -19,6 +19,7 @@ use function count; use function in_array; use function is_array; +use function sprintf; class CheckAlgorithm implements CeremonyStep { @@ -33,7 +34,7 @@ public function process( return; } $credentialPublicKey = $publicKeyCredentialSource->getAttestedCredentialData() -->credentialPublicKey; + ->credentialPublicKey; $credentialPublicKey !== null || throw AuthenticatorResponseVerificationException::create( 'No public key available.' ); diff --git a/src/webauthn/src/CeremonyStep/CheckMetadataStatement.php b/src/webauthn/src/CeremonyStep/CheckMetadataStatement.php index ce482a4a7..59c23c754 100644 --- a/src/webauthn/src/CeremonyStep/CheckMetadataStatement.php +++ b/src/webauthn/src/CeremonyStep/CheckMetadataStatement.php @@ -22,6 +22,7 @@ use Webauthn\TrustPath\CertificateTrustPath; use function count; use function in_array; +use function sprintf; final class CheckMetadataStatement implements CeremonyStep, CanLogData { diff --git a/src/webauthn/src/CeremonyStep/CheckSignature.php b/src/webauthn/src/CeremonyStep/CheckSignature.php index a89fef324..20454dc83 100644 --- a/src/webauthn/src/CeremonyStep/CheckSignature.php +++ b/src/webauthn/src/CeremonyStep/CheckSignature.php @@ -43,7 +43,7 @@ public function process( return; } $credentialPublicKey = $publicKeyCredentialSource->getAttestedCredentialData() -->credentialPublicKey; + ->credentialPublicKey; $credentialPublicKey !== null || throw AuthenticatorResponseVerificationException::create( 'No public key available.' ); diff --git a/src/webauthn/src/ClientDataCollector/WebauthnAuthenticationCollector.php b/src/webauthn/src/ClientDataCollector/WebauthnAuthenticationCollector.php index 1a316e258..ea97fdf1e 100644 --- a/src/webauthn/src/ClientDataCollector/WebauthnAuthenticationCollector.php +++ b/src/webauthn/src/ClientDataCollector/WebauthnAuthenticationCollector.php @@ -9,6 +9,7 @@ use Webauthn\Exception\AuthenticatorResponseVerificationException; use Webauthn\PublicKeyCredentialOptions; use function in_array; +use function sprintf; final class WebauthnAuthenticationCollector implements ClientDataCollector { diff --git a/src/webauthn/src/CollectedClientData.php b/src/webauthn/src/CollectedClientData.php index 3731207bb..f7c14b531 100644 --- a/src/webauthn/src/CollectedClientData.php +++ b/src/webauthn/src/CollectedClientData.php @@ -10,6 +10,7 @@ use function array_key_exists; use function is_array; use function is_string; +use function sprintf; use const JSON_THROW_ON_ERROR; class CollectedClientData diff --git a/src/webauthn/src/Denormalizer/AttestationObjectDenormalizer.php b/src/webauthn/src/Denormalizer/AttestationObjectDenormalizer.php index 4eaeb917e..eae463088 100644 --- a/src/webauthn/src/Denormalizer/AttestationObjectDenormalizer.php +++ b/src/webauthn/src/Denormalizer/AttestationObjectDenormalizer.php @@ -46,8 +46,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a ); } - 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 61f8bf751..fc3d0be0a 100644 --- a/src/webauthn/src/Denormalizer/AttestationStatementDenormalizer.php +++ b/src/webauthn/src/Denormalizer/AttestationStatementDenormalizer.php @@ -22,8 +22,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a 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 ce126e7a7..9c2e80a5d 100644 --- a/src/webauthn/src/Denormalizer/AuthenticationExtensionsDenormalizer.php +++ b/src/webauthn/src/Denormalizer/AuthenticationExtensionsDenormalizer.php @@ -33,8 +33,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a 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 4b2432e00..fd8927ff2 100644 --- a/src/webauthn/src/Denormalizer/AuthenticatorAssertionResponseDenormalizer.php +++ b/src/webauthn/src/Denormalizer/AuthenticatorAssertionResponseDenormalizer.php @@ -42,8 +42,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a ); } - 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 d59303cac..a634fb6a9 100644 --- a/src/webauthn/src/Denormalizer/AuthenticatorAttestationResponseDenormalizer.php +++ b/src/webauthn/src/Denormalizer/AuthenticatorAttestationResponseDenormalizer.php @@ -42,8 +42,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a ); } - 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 134b6bed0..12aa21e06 100644 --- a/src/webauthn/src/Denormalizer/AuthenticatorDataDenormalizer.php +++ b/src/webauthn/src/Denormalizer/AuthenticatorDataDenormalizer.php @@ -87,8 +87,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a ); } - 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 8ab3aaef8..63d152def 100644 --- a/src/webauthn/src/Denormalizer/AuthenticatorResponseDenormalizer.php +++ b/src/webauthn/src/Denormalizer/AuthenticatorResponseDenormalizer.php @@ -28,8 +28,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a 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 ac47524ae..fec3a7481 100644 --- a/src/webauthn/src/Denormalizer/CollectedClientDataDenormalizer.php +++ b/src/webauthn/src/Denormalizer/CollectedClientDataDenormalizer.php @@ -19,8 +19,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a 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 4d69b42a5..d67afd910 100644 --- a/src/webauthn/src/Denormalizer/ExtensionDescriptorDenormalizer.php +++ b/src/webauthn/src/Denormalizer/ExtensionDescriptorDenormalizer.php @@ -31,8 +31,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a 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 f1213ca4f..ba5508927 100644 --- a/src/webauthn/src/Denormalizer/PublicKeyCredentialDenormalizer.php +++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialDenormalizer.php @@ -36,8 +36,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a ); } - 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 2007d518c..326a37378 100644 --- a/src/webauthn/src/Denormalizer/PublicKeyCredentialOptionsDenormalizer.php +++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialOptionsDenormalizer.php @@ -103,8 +103,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a 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, [PublicKeyCredentialCreationOptions::class, PublicKeyCredentialRequestOptions::class], diff --git a/src/webauthn/src/Denormalizer/PublicKeyCredentialParametersDenormalizer.php b/src/webauthn/src/Denormalizer/PublicKeyCredentialParametersDenormalizer.php index a35062a1e..0114c3a6a 100644 --- a/src/webauthn/src/Denormalizer/PublicKeyCredentialParametersDenormalizer.php +++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialParametersDenormalizer.php @@ -20,8 +20,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a 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 9d8633577..3a963afa6 100644 --- a/src/webauthn/src/Denormalizer/PublicKeyCredentialSourceDenormalizer.php +++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialSourceDenormalizer.php @@ -49,8 +49,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a ); } - 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 3c5e300bd..0ac7f5d12 100644 --- a/src/webauthn/src/Denormalizer/PublicKeyCredentialUserEntityDenormalizer.php +++ b/src/webauthn/src/Denormalizer/PublicKeyCredentialUserEntityDenormalizer.php @@ -29,8 +29,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a ); } - 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 9eb2508f4..4a565ed88 100644 --- a/src/webauthn/src/Denormalizer/TrustPathDenormalizer.php +++ b/src/webauthn/src/Denormalizer/TrustPathDenormalizer.php @@ -26,8 +26,12 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a }; } - 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/Denormalizer/WebauthnSerializerFactory.php b/src/webauthn/src/Denormalizer/WebauthnSerializerFactory.php index be9f7ce26..f7dc10915 100644 --- a/src/webauthn/src/Denormalizer/WebauthnSerializerFactory.php +++ b/src/webauthn/src/Denormalizer/WebauthnSerializerFactory.php @@ -15,6 +15,7 @@ use Symfony\Component\Serializer\Serializer; use Symfony\Component\Serializer\SerializerInterface; use Webauthn\AttestationStatement\AttestationStatementSupportManager; +use function sprintf; final class WebauthnSerializerFactory { diff --git a/src/webauthn/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php b/src/webauthn/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php index fb542c43a..f46b6d7de 100644 --- a/src/webauthn/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php +++ b/src/webauthn/src/Event/AuthenticatorAssertionResponseValidationFailedEvent.php @@ -9,6 +9,7 @@ use Webauthn\AuthenticatorAssertionResponse; use Webauthn\PublicKeyCredentialRequestOptions; use Webauthn\PublicKeyCredentialSource; +use function sprintf; class AuthenticatorAssertionResponseValidationFailedEvent { diff --git a/src/webauthn/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.php b/src/webauthn/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.php index 88442b171..75925582a 100644 --- a/src/webauthn/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.php +++ b/src/webauthn/src/Event/AuthenticatorAssertionResponseValidationSucceededEvent.php @@ -8,6 +8,7 @@ use Webauthn\AuthenticatorAssertionResponse; use Webauthn\PublicKeyCredentialRequestOptions; use Webauthn\PublicKeyCredentialSource; +use function sprintf; class AuthenticatorAssertionResponseValidationSucceededEvent { diff --git a/src/webauthn/src/Event/AuthenticatorAttestationResponseValidationFailedEvent.php b/src/webauthn/src/Event/AuthenticatorAttestationResponseValidationFailedEvent.php index 59f7403b9..3c8168d5c 100644 --- a/src/webauthn/src/Event/AuthenticatorAttestationResponseValidationFailedEvent.php +++ b/src/webauthn/src/Event/AuthenticatorAttestationResponseValidationFailedEvent.php @@ -8,6 +8,7 @@ use Throwable; use Webauthn\AuthenticatorAttestationResponse; use Webauthn\PublicKeyCredentialCreationOptions; +use function sprintf; class AuthenticatorAttestationResponseValidationFailedEvent { diff --git a/src/webauthn/src/Event/AuthenticatorAttestationResponseValidationSucceededEvent.php b/src/webauthn/src/Event/AuthenticatorAttestationResponseValidationSucceededEvent.php index 59cca9516..6145464ec 100644 --- a/src/webauthn/src/Event/AuthenticatorAttestationResponseValidationSucceededEvent.php +++ b/src/webauthn/src/Event/AuthenticatorAttestationResponseValidationSucceededEvent.php @@ -8,6 +8,7 @@ use Webauthn\AuthenticatorAttestationResponse; use Webauthn\PublicKeyCredentialCreationOptions; use Webauthn\PublicKeyCredentialSource; +use function sprintf; class AuthenticatorAttestationResponseValidationSucceededEvent { diff --git a/src/webauthn/src/MetadataService/CertificateChain/PhpCertificateChainValidator.php b/src/webauthn/src/MetadataService/CertificateChain/PhpCertificateChainValidator.php index b7a676d1b..ff50e7e7d 100644 --- a/src/webauthn/src/MetadataService/CertificateChain/PhpCertificateChainValidator.php +++ b/src/webauthn/src/MetadataService/CertificateChain/PhpCertificateChainValidator.php @@ -29,6 +29,7 @@ use function count; use function in_array; use function parse_url; +use function sprintf; use const PHP_EOL; use const PHP_URL_SCHEME; diff --git a/src/webauthn/src/MetadataService/Service/MetadataBLOBPayload.php b/src/webauthn/src/MetadataService/Service/MetadataBLOBPayload.php index 0bd5df806..97df91c57 100644 --- a/src/webauthn/src/MetadataService/Service/MetadataBLOBPayload.php +++ b/src/webauthn/src/MetadataService/Service/MetadataBLOBPayload.php @@ -11,6 +11,7 @@ use function is_array; use function is_int; use function is_string; +use function sprintf; class MetadataBLOBPayload implements JsonSerializable { diff --git a/src/webauthn/src/MetadataService/Statement/DisplayPNGCharacteristicsDescriptor.php b/src/webauthn/src/MetadataService/Statement/DisplayPNGCharacteristicsDescriptor.php index f69703038..e0c8603b3 100644 --- a/src/webauthn/src/MetadataService/Statement/DisplayPNGCharacteristicsDescriptor.php +++ b/src/webauthn/src/MetadataService/Statement/DisplayPNGCharacteristicsDescriptor.php @@ -8,6 +8,7 @@ use Webauthn\Exception\MetadataStatementLoadingException; use Webauthn\MetadataService\ValueFilter; use function array_key_exists; +use function sprintf; class DisplayPNGCharacteristicsDescriptor implements JsonSerializable { diff --git a/src/webauthn/src/MetadataService/Statement/EcdaaTrustAnchor.php b/src/webauthn/src/MetadataService/Statement/EcdaaTrustAnchor.php index c55171b32..2d565d314 100644 --- a/src/webauthn/src/MetadataService/Statement/EcdaaTrustAnchor.php +++ b/src/webauthn/src/MetadataService/Statement/EcdaaTrustAnchor.php @@ -9,6 +9,7 @@ use Webauthn\Exception\MetadataStatementLoadingException; use Webauthn\MetadataService\ValueFilter; use function array_key_exists; +use function sprintf; /** * @deprecated since 4.2.0 and will be removed in 5.0.0. The ECDAA Trust Anchor does no longer exist in Webauthn specification. diff --git a/src/webauthn/src/MetadataService/Statement/MetadataStatement.php b/src/webauthn/src/MetadataService/Statement/MetadataStatement.php index 899430eaf..5f6afd509 100644 --- a/src/webauthn/src/MetadataService/Statement/MetadataStatement.php +++ b/src/webauthn/src/MetadataService/Statement/MetadataStatement.php @@ -11,6 +11,7 @@ use function array_key_exists; use function is_array; use function is_string; +use function sprintf; use const JSON_THROW_ON_ERROR; class MetadataStatement implements JsonSerializable diff --git a/src/webauthn/src/MetadataService/Statement/PatternAccuracyDescriptor.php b/src/webauthn/src/MetadataService/Statement/PatternAccuracyDescriptor.php index f065bbeec..8ceed8b8d 100644 --- a/src/webauthn/src/MetadataService/Statement/PatternAccuracyDescriptor.php +++ b/src/webauthn/src/MetadataService/Statement/PatternAccuracyDescriptor.php @@ -8,6 +8,7 @@ use Webauthn\MetadataService\ValueFilter; use function array_key_exists; use function is_int; +use function sprintf; class PatternAccuracyDescriptor extends AbstractDescriptor { diff --git a/src/webauthn/src/MetadataService/Statement/RgbPaletteEntry.php b/src/webauthn/src/MetadataService/Statement/RgbPaletteEntry.php index ca850789a..73061b44a 100644 --- a/src/webauthn/src/MetadataService/Statement/RgbPaletteEntry.php +++ b/src/webauthn/src/MetadataService/Statement/RgbPaletteEntry.php @@ -8,6 +8,7 @@ use Webauthn\Exception\MetadataStatementLoadingException; use function array_key_exists; use function is_int; +use function sprintf; class RgbPaletteEntry implements JsonSerializable { diff --git a/src/webauthn/src/MetadataService/Statement/StatusReport.php b/src/webauthn/src/MetadataService/Statement/StatusReport.php index c1fba596d..c0cc42792 100644 --- a/src/webauthn/src/MetadataService/Statement/StatusReport.php +++ b/src/webauthn/src/MetadataService/Statement/StatusReport.php @@ -10,6 +10,7 @@ use function array_key_exists; use function in_array; use function is_string; +use function sprintf; class StatusReport implements JsonSerializable { diff --git a/src/webauthn/src/MetadataService/Statement/VerificationMethodDescriptor.php b/src/webauthn/src/MetadataService/Statement/VerificationMethodDescriptor.php index fe700f833..89184644f 100644 --- a/src/webauthn/src/MetadataService/Statement/VerificationMethodDescriptor.php +++ b/src/webauthn/src/MetadataService/Statement/VerificationMethodDescriptor.php @@ -9,6 +9,7 @@ use Webauthn\MetadataService\ValueFilter; use function array_key_exists; use function is_array; +use function sprintf; class VerificationMethodDescriptor implements JsonSerializable { diff --git a/src/webauthn/src/MetadataService/Statement/Version.php b/src/webauthn/src/MetadataService/Statement/Version.php index 1a0f77153..56b7b0faf 100644 --- a/src/webauthn/src/MetadataService/Statement/Version.php +++ b/src/webauthn/src/MetadataService/Statement/Version.php @@ -9,6 +9,7 @@ use Webauthn\MetadataService\ValueFilter; use function array_key_exists; use function is_int; +use function sprintf; class Version implements JsonSerializable { diff --git a/src/webauthn/src/PublicKeyCredential.php b/src/webauthn/src/PublicKeyCredential.php index 8e09ad656..b4930f803 100644 --- a/src/webauthn/src/PublicKeyCredential.php +++ b/src/webauthn/src/PublicKeyCredential.php @@ -5,6 +5,7 @@ namespace Webauthn; use Stringable; +use function sprintf; use const E_USER_DEPRECATED; use const JSON_THROW_ON_ERROR; diff --git a/src/webauthn/src/PublicKeyCredentialLoader.php b/src/webauthn/src/PublicKeyCredentialLoader.php index 88b2a9c17..8c28d5389 100644 --- a/src/webauthn/src/PublicKeyCredentialLoader.php +++ b/src/webauthn/src/PublicKeyCredentialLoader.php @@ -17,6 +17,7 @@ use function array_key_exists; use function is_array; use function is_string; +use function sprintf; use const JSON_THROW_ON_ERROR; /** diff --git a/src/webauthn/src/PublicKeyCredentialSource.php b/src/webauthn/src/PublicKeyCredentialSource.php index 2aef84ef0..fe1ab1808 100644 --- a/src/webauthn/src/PublicKeyCredentialSource.php +++ b/src/webauthn/src/PublicKeyCredentialSource.php @@ -13,6 +13,7 @@ use Webauthn\TrustPath\TrustPathLoader; use function array_key_exists; use function in_array; +use function sprintf; /** * @see https://www.w3.org/TR/webauthn/#iface-pkcredential diff --git a/src/webauthn/src/StringStream.php b/src/webauthn/src/StringStream.php index 06784e7c8..44f718515 100644 --- a/src/webauthn/src/StringStream.php +++ b/src/webauthn/src/StringStream.php @@ -11,6 +11,7 @@ use function fread; use function fwrite; use function rewind; +use function sprintf; final class StringStream implements Stream { diff --git a/src/webauthn/src/TokenBinding/TokenBinding.php b/src/webauthn/src/TokenBinding/TokenBinding.php index cffc6ded5..26a2cb7b4 100644 --- a/src/webauthn/src/TokenBinding/TokenBinding.php +++ b/src/webauthn/src/TokenBinding/TokenBinding.php @@ -8,6 +8,7 @@ use Webauthn\Exception\InvalidDataException; use function array_key_exists; use function in_array; +use function sprintf; /** * @deprecated Since 4.3.0 and will be removed in 5.0.0 diff --git a/tests/framework/ComposerJsonTest.php b/tests/framework/ComposerJsonTest.php index 9e66a2a98..ea3e5087a 100644 --- a/tests/framework/ComposerJsonTest.php +++ b/tests/framework/ComposerJsonTest.php @@ -8,6 +8,7 @@ use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Traversable; +use function sprintf; use const JSON_THROW_ON_ERROR; /** diff --git a/tests/library/AbstractTestCase.php b/tests/library/AbstractTestCase.php index 48fc750e3..a01480a4b 100644 --- a/tests/library/AbstractTestCase.php +++ b/tests/library/AbstractTestCase.php @@ -41,6 +41,7 @@ use Webauthn\Tests\Bundle\Functional\MockClock; use Webauthn\Tests\Functional\MetadataStatementRepository; use Webauthn\Tests\Functional\StatusReportRepository; +use function sprintf; abstract class AbstractTestCase extends TestCase { diff --git a/tests/library/Unit/AuthenticationExtensions/AuthenticationExtensionsClientTest.php b/tests/library/Unit/AuthenticationExtensions/AuthenticationExtensionsClientTest.php index dc8118f74..1b42762c6 100644 --- a/tests/library/Unit/AuthenticationExtensions/AuthenticationExtensionsClientTest.php +++ b/tests/library/Unit/AuthenticationExtensions/AuthenticationExtensionsClientTest.php @@ -35,7 +35,7 @@ public function theAuthenticationExtensionsClientInputsCanManageExtensions(): vo AuthenticationExtension::create('name', ['value']), ]); - static::assertSame(1, $inputs->count()); + static::assertCount(1, $inputs); static::assertSame('{"name":["value"]}', $this->getSerializer()->serialize($inputs, 'json', [ AbstractObjectNormalizer::SKIP_NULL_VALUES => true, ])); @@ -49,7 +49,7 @@ public function theAuthenticationExtensionsClientOutputsCanManageExtensions(): v AuthenticationExtension::create('name', ['value']), ]); - static::assertSame(1, $inputs->count()); + static::assertCount(1, $inputs); static::assertSame('{"name":["value"]}', $this->getSerializer()->serialize($inputs, 'json', [ AbstractObjectNormalizer::SKIP_NULL_VALUES => true, ])); diff --git a/tests/symfony/functional/MockClientCallback.php b/tests/symfony/functional/MockClientCallback.php index 11294f81b..b699dc378 100644 --- a/tests/symfony/functional/MockClientCallback.php +++ b/tests/symfony/functional/MockClientCallback.php @@ -6,6 +6,7 @@ use RuntimeException; use Symfony\Contracts\HttpClient\ResponseInterface; +use function sprintf; /** * @internal diff --git a/tests/symfony/functional/SingleFileService.php b/tests/symfony/functional/SingleFileService.php index 18385c5ce..b07d15d47 100644 --- a/tests/symfony/functional/SingleFileService.php +++ b/tests/symfony/functional/SingleFileService.php @@ -10,6 +10,7 @@ use Webauthn\MetadataService\Service\MetadataService; use Webauthn\MetadataService\Statement\MetadataStatement; use function array_key_exists; +use function sprintf; final class SingleFileService implements MetadataService { diff --git a/tests/symfony/functional/UserProvider.php b/tests/symfony/functional/UserProvider.php index 7915163a6..127806c74 100644 --- a/tests/symfony/functional/UserProvider.php +++ b/tests/symfony/functional/UserProvider.php @@ -7,6 +7,7 @@ use Symfony\Component\Security\Core\Exception\UserNotFoundException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; +use function sprintf; final class UserProvider implements UserProviderInterface {