SafetyNetResponse::getCertificateChain()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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