AuthenticatorAttachment   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isValidValue() 0 3 2
A __construct() 0 2 1
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