UnsupportedAttestationVerifier   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A verify() 0 6 2
1
<?php
2
3
namespace MadWizard\WebAuthn\Attestation\Verifier;
4
5
use MadWizard\WebAuthn\Attestation\AttestationType;
6
use MadWizard\WebAuthn\Attestation\AuthenticatorData;
7
use MadWizard\WebAuthn\Attestation\Statement\AttestationStatementInterface;
8
use MadWizard\WebAuthn\Attestation\Statement\UnsupportedAttestationStatement;
9
use MadWizard\WebAuthn\Attestation\TrustPath\EmptyTrustPath;
10
use MadWizard\WebAuthn\Exception\VerificationException;
11
12
class UnsupportedAttestationVerifier implements AttestationVerifierInterface
13
{
14
    public function verify(AttestationStatementInterface $attStmt, AuthenticatorData $authenticatorData, string $clientDataHash): VerificationResult
15
    {
16
        if (!($attStmt instanceof UnsupportedAttestationStatement)) {
17
            throw new VerificationException('Expecting UnsupportedAttestationStatement.');
18
        }
19
        return new VerificationResult(AttestationType::NONE, new EmptyTrustPath());
20
    }
21
}
22