Fixes static analysis
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user