Completed
Push — master ( d7d555...8d86ce )
by Thomas
06:51 queued 03:43
created

CredentialRegistration::getSignCounter()   A

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 0
Metric Value
cc 1
eloc 1
c 0
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\Credential;
4
5
use MadWizard\WebAuthn\Crypto\CoseKeyInterface;
6
use MadWizard\WebAuthn\Format\ByteBuffer;
7
8
final class CredentialRegistration
9
{
10
    /**
11
     * @var CredentialId
12
     */
13
    private $credentialId;
14
15
    /**
16
     * @var int
17
     */
18
    private $signCounter;
19
20
    /**
21
     * @var CoseKeyInterface
22
     */
23
    private $publicKey;
24
25
    /**
26
     * @var UserHandle
27
     */
28
    private $userHandle;
29
30
    /**
31
     * @var ByteBuffer
32
     */
33
    private $attestationObject;
34
35 2
    public function __construct(CredentialId $credentialId, CoseKeyInterface $publicKey, UserHandle $userHandle, ByteBuffer $attestationObject, int $signCounter)
36
    {
37 2
        $this->credentialId = $credentialId;
38 2
        $this->publicKey = $publicKey;
39 2
        $this->userHandle = $userHandle;
40 2
        $this->attestationObject = $attestationObject;
41 2
        $this->signCounter = $signCounter;
42 2
    }
43
44 2
    public function getCredentialId(): CredentialId
45
    {
46 2
        return $this->credentialId;
47
    }
48
49 1
    public function getSignCounter(): int
50
    {
51 1
        return $this->signCounter;
52
    }
53
54 2
    public function getPublicKey(): CoseKeyInterface
55
    {
56 2
        return $this->publicKey;
57
    }
58
59 2
    public function getUserHandle(): UserHandle
60
    {
61 2
        return $this->userHandle;
62
    }
63
64 1
    public function getAttestationObject(): ByteBuffer
65
    {
66 1
        return $this->attestationObject;
67
    }
68
}
69