AttestationConveyancePreference   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A isValidValue() 0 3 3
1
<?php
2
3
namespace MadWizard\WebAuthn\Dom;
4
5
final class AttestationConveyancePreference
6
{
7
    /**
8
     *  Indicates that the Relying Party is not interested in authenticator attestation. F.
9
     */
10
    public const NONE = 'none';
11
12
    /**
13
     *  Indicates that the Relying Party prefers an attestation conveyance yielding verifiable attestation statements,
14
     *  but allows the client to decide how to obtain such attestation statements.
15
     */
16
    public const INDRECT = 'indirect';
17
18
    /**
19
     * Indicates that the Relying Party wants to receive the attestation statement as generated by the authenticator.
20
     */
21
    public const DIRECT = 'direct';
22
23
    /**
24
     * @codeCoverageIgnore
25
     */
26
    private function __construct()
27
    {
28
    }
29
30 2
    public static function isValidValue(string $value): bool
31
    {
32 2
        return $value === self::NONE || $value === self::INDRECT || $value === self::DIRECT;
33
    }
34
}
35