AuthenticatorAssertionResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A asAssertionResponse() 0 3 1
A __construct() 0 6 1
A getUserHandle() 0 3 1
A getSignature() 0 3 1
A getAuthenticatorData() 0 3 1
1
<?php
2
3
namespace MadWizard\WebAuthn\Dom;
4
5
use MadWizard\WebAuthn\Format\ByteBuffer;
6
7
final class AuthenticatorAssertionResponse extends AbstractAuthenticatorResponse implements AuthenticatorAssertionResponseInterface
8
{
9
    /**
10
     * @var ByteBuffer
11
     */
12
    private $authenticatorData;
13
14
    /**
15
     * @var ByteBuffer
16
     */
17
    private $signature;
18
19
    /**
20
     * @var ByteBuffer|null
21
     */
22
    private $userHandle;
23
24 19
    public function __construct(string $clientDataJson, ByteBuffer $authenticatorData, ByteBuffer $signature, ?ByteBuffer $userHandle)
25
    {
26 19
        parent::__construct($clientDataJson);
27 14
        $this->authenticatorData = $authenticatorData;
28 14
        $this->signature = $signature;
29 14
        $this->userHandle = $userHandle;
30 14
    }
31
32 13
    public function getAuthenticatorData(): ByteBuffer
33
    {
34 13
        return $this->authenticatorData;
35
    }
36
37 6
    public function getSignature(): ByteBuffer
38
    {
39 6
        return $this->signature;
40
    }
41
42 12
    public function getUserHandle(): ?ByteBuffer
43
    {
44 12
        return $this->userHandle;
45
    }
46
47 11
    public function asAssertionResponse(): AuthenticatorAssertionResponseInterface
48
    {
49 11
        return $this;
50
    }
51
}
52