SafetyNetResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 54
ccs 14
cts 14
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getTimestampMs() 0 3 1
A getNonce() 0 3 1
A isCtsProfileMatch() 0 3 1
A getCertificateChain() 0 3 1
1
<?php
2
3
namespace MadWizard\WebAuthn\Attestation\Android;
4
5
use MadWizard\WebAuthn\Pki\X509Certificate;
6
7
final class SafetyNetResponse implements SafetyNetResponseInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $nonce;
13
14
    /**
15
     * @var X509Certificate[]
16
     */
17
    private $x5c;
18
19
    /**
20
     * @var bool
21
     */
22
    private $ctsProfileMatch;
23
24
    /**
25
     * @var int|float
26
     */
27
    private $timestampMs;
28
29
    /**
30
     * @param int|float $timestampMs
31
     */
32 2
    public function __construct(string $nonce, array $x5c, bool $ctsProfileMatch, $timestampMs)
33
    {
34 2
        $this->nonce = $nonce;
35 2
        $this->x5c = $x5c;
36 2
        $this->ctsProfileMatch = $ctsProfileMatch;
37 2
        $this->timestampMs = $timestampMs;
38 2
    }
39
40 2
    public function getNonce(): string
41
    {
42 2
        return $this->nonce;
43
    }
44
45
    /**
46
     * @return X509Certificate[]
47
     */
48 2
    public function getCertificateChain(): array
49
    {
50 2
        return $this->x5c;
51
    }
52
53 2
    public function isCtsProfileMatch(): bool
54
    {
55 2
        return $this->ctsProfileMatch;
56
    }
57
58 1
    public function getTimestampMs()
59
    {
60 1
        return $this->timestampMs;
61
    }
62
}
63