UnsupportedAttestationVerifier::verify()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 3
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 6
rs 10
c 1
b 0
f 0
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