ResidentKeyRequirement   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A isValidValue() 0 3 2
1
<?php
2
3
namespace MadWizard\WebAuthn\Dom;
4
5
final class ResidentKeyRequirement
6
{
7
    public const DISCOURAGED = 'discouraged';
8
9
    // Not in us yet until level 2 spec
10
    // public const PREFERRED = 'preferred';
11
12
    public const REQUIRED = 'required';
13
14
    public const DEFAULT = self::DISCOURAGED;
15
16
    /**
17
     * @codeCoverageIgnore
18
     */
19
    private function __construct()
20
    {
21
    }
22
23
    public static function isValidValue(string $value): bool
24
    {
25
        return $value === self::DISCOURAGED || $value === self::REQUIRED;
26
    }
27
}
28