TocItem::getHash()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace MadWizard\WebAuthn\Metadata\Statement;
4
5
use MadWizard\WebAuthn\Attestation\Identifier\IdentifierInterface;
6
use MadWizard\WebAuthn\Format\ByteBuffer;
7
8
class TocItem
9
{
10
    /**
11
     * @var IdentifierInterface
12
     */
13
    private $identifier;
14
15
    /**
16
     * @var ByteBuffer|null
17
     */
18
    private $hash;
19
20
    /**
21
     * @var string|null
22
     */
23
    private $url;
24
25
    /**
26
     * @var StatusReport[]
27
     */
28
    private $statusReports;
29
30
    /**
31
     * @param StatusReport[] $statusReports
32
     */
33
    public function __construct(IdentifierInterface $identifier, ?ByteBuffer $hash, ?string $url, array $statusReports)
34
    {
35
        $this->identifier = $identifier;
36
        $this->hash = $hash;
37
        $this->url = $url;
38
        $this->statusReports = $statusReports;
39
    }
40
41
    public function getIdentifier(): IdentifierInterface
42
    {
43
        return $this->identifier;
44
    }
45
46
    public function getHash(): ?ByteBuffer
47
    {
48
        return $this->hash;
49
    }
50
51
    public function getUrl(): ?string
52
    {
53
        return $this->url;
54
    }
55
56
    /**
57
     * @return StatusReport[]
58
     */
59
    public function getStatusReports(): array
60
    {
61
        return $this->statusReports;
62
    }
63
}
64