Fixes static analysis

This commit is contained in:
Italo
2022-07-27 14:03:56 -04:00
committed by GitHub
parent c02f826928
commit 21db20d103
4 changed files with 5 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ class CreateAssertionChallenge
$options = []; $options = [];
if ($assertion->acceptedCredentials?->isNotEmpty()) { if ($assertion->acceptedCredentials?->isNotEmpty()) {
// @phpstan-ignore-next-line
$options['credentials'] = $assertion->acceptedCredentials->map->getKey()->toArray(); $options['credentials'] = $assertion->acceptedCredentials->map->getKey()->toArray();
} }

View File

@@ -36,7 +36,7 @@ class MayRetrieveCredentialsIdForUser
* Adapt all credentials into an `allowCredentials` digestible array. * Adapt all credentials into an `allowCredentials` digestible array.
* *
* @param \Illuminate\Database\Eloquent\Collection<int, \Laragear\WebAuthn\Models\WebAuthnCredential> $credentials * @param \Illuminate\Database\Eloquent\Collection<int, \Laragear\WebAuthn\Models\WebAuthnCredential> $credentials
* @return \Illuminate\Support\Collection<int, array> * @return Illuminate\Support\Collection<int, array{id?: mixed, type: string, transports?: non-empty-array<int, string>}>
*/ */
protected function parseCredentials(EloquentCollection $credentials): Collection protected function parseCredentials(EloquentCollection $credentials): Collection
{ {

View File

@@ -56,6 +56,7 @@ class CheckCredentialIsForUser
*/ */
protected function validateUser(AssertionValidation $validation): void protected function validateUser(AssertionValidation $validation): void
{ {
// @phpstan-ignore-next-line
if ($validation->credential->authenticatable()->isNot($validation->user)) { if ($validation->credential->authenticatable()->isNot($validation->user)) {
throw AssertionException::make('User is not owner of the stored credential.'); throw AssertionException::make('User is not owner of the stored credential.');
} }

View File

@@ -76,10 +76,10 @@ class AuthenticatorData
* @param string $relyingPartyIdHash * @param string $relyingPartyIdHash
* @param object $flags * @param object $flags
* @param int $counter * @param int $counter
* @param object{aaguid: int|bool, credentialId: string, credentialPublicKey: string} $attestedCredentialData * @param object $attestedCredentialData
* @param array $extensionData * @param array $extensionData
*/ */
public function __construct( final public function __construct(
public string $relyingPartyIdHash, public string $relyingPartyIdHash,
public object $flags, public object $flags,
public int $counter, public int $counter,