AttestationConveyancePreference::isValidValue()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 3

Importance

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