AuthenticatorAttachment::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace MadWizard\WebAuthn\Dom;
4
5
final class AuthenticatorAttachment
6
{
7
    /**
8
     * Platform attachment
9
     * The respective authenticator is attached using platform-specific transports.
10
     * Usually, authenticators of this class are non-removable from the platform. A public key credential bound
11
     * to a platform authenticator is called a platform credential.
12
     */
13
    public const PLATFORM = 'platform';
14
15
    /**
16
     * Cross-platform attachment
17
     * The respective authenticator is attached using cross-platform transports. Authenticators of this class are
18
     * removable from, and can "roam" among, client platforms. A public key credential bound to a roaming authenticator
19
     * is called a roaming credential.
20
     */
21
    public const CROSS_PLATFORM = 'cross-platform';
22
23
    /**
24
     * @codeCoverageIgnore
25
     */
26
    private function __construct()
27
    {
28
    }
29
30 3
    public static function isValidValue(string $value): bool
31
    {
32 3
        return $value === self::PLATFORM || $value === self::CROSS_PLATFORM;
33
    }
34
}
35