Passed
Push — master ( 022bc2...5c7e77 )
by Thomas
03:17
created

ResidentKeyRequirement::isValidValue()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

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