From 21db20d103c921f0f9307e7037b17671d9133819 Mon Sep 17 00:00:00 2001 From: Italo Date: Wed, 27 Jul 2022 14:03:56 -0400 Subject: [PATCH] Fixes static analysis --- src/Assertion/Creator/Pipes/CreateAssertionChallenge.php | 1 + .../Creator/Pipes/MayRetrieveCredentialsIdForUser.php | 2 +- src/Assertion/Validator/Pipes/CheckCredentialIsForUser.php | 1 + src/Attestation/AuthenticatorData.php | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Assertion/Creator/Pipes/CreateAssertionChallenge.php b/src/Assertion/Creator/Pipes/CreateAssertionChallenge.php index 0a4860b..c9d78b1 100644 --- a/src/Assertion/Creator/Pipes/CreateAssertionChallenge.php +++ b/src/Assertion/Creator/Pipes/CreateAssertionChallenge.php @@ -33,6 +33,7 @@ class CreateAssertionChallenge $options = []; if ($assertion->acceptedCredentials?->isNotEmpty()) { + // @phpstan-ignore-next-line $options['credentials'] = $assertion->acceptedCredentials->map->getKey()->toArray(); } diff --git a/src/Assertion/Creator/Pipes/MayRetrieveCredentialsIdForUser.php b/src/Assertion/Creator/Pipes/MayRetrieveCredentialsIdForUser.php index 424cc0e..77d0824 100644 --- a/src/Assertion/Creator/Pipes/MayRetrieveCredentialsIdForUser.php +++ b/src/Assertion/Creator/Pipes/MayRetrieveCredentialsIdForUser.php @@ -36,7 +36,7 @@ class MayRetrieveCredentialsIdForUser * Adapt all credentials into an `allowCredentials` digestible array. * * @param \Illuminate\Database\Eloquent\Collection $credentials - * @return \Illuminate\Support\Collection + * @return Illuminate\Support\Collection}> */ protected function parseCredentials(EloquentCollection $credentials): Collection { diff --git a/src/Assertion/Validator/Pipes/CheckCredentialIsForUser.php b/src/Assertion/Validator/Pipes/CheckCredentialIsForUser.php index 44561b5..cd56e32 100644 --- a/src/Assertion/Validator/Pipes/CheckCredentialIsForUser.php +++ b/src/Assertion/Validator/Pipes/CheckCredentialIsForUser.php @@ -56,6 +56,7 @@ class CheckCredentialIsForUser */ protected function validateUser(AssertionValidation $validation): void { + // @phpstan-ignore-next-line if ($validation->credential->authenticatable()->isNot($validation->user)) { throw AssertionException::make('User is not owner of the stored credential.'); } diff --git a/src/Attestation/AuthenticatorData.php b/src/Attestation/AuthenticatorData.php index bef0f1e..ea26191 100644 --- a/src/Attestation/AuthenticatorData.php +++ b/src/Attestation/AuthenticatorData.php @@ -76,10 +76,10 @@ class AuthenticatorData * @param string $relyingPartyIdHash * @param object $flags * @param int $counter - * @param object{aaguid: int|bool, credentialId: string, credentialPublicKey: string} $attestedCredentialData + * @param object $attestedCredentialData * @param array $extensionData */ - public function __construct( + final public function __construct( public string $relyingPartyIdHash, public object $flags, public int $counter,