UserCredential   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 37
ccs 11
cts 11
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCredentialId() 0 3 1
A getPublicKey() 0 3 1
A getUserHandle() 0 3 1
1
<?php
2
3
namespace MadWizard\WebAuthn\Credential;
4
5
use MadWizard\WebAuthn\Crypto\CoseKeyInterface;
6
7
class UserCredential implements UserCredentialInterface
8
{
9
    /**
10
     * @var CredentialId
11
     */
12
    private $credentialId;
13
14
    /**
15
     * @var CoseKeyInterface
16
     */
17
    private $publicKey;
18
19
    /**
20
     * @var UserHandle
21
     */
22
    private $userHandle;
23
24 1
    public function __construct(CredentialId $credentialId, CoseKeyInterface $publicKey, UserHandle $userHandle)
25
    {
26 1
        $this->credentialId = $credentialId;
27 1
        $this->publicKey = $publicKey;
28 1
        $this->userHandle = $userHandle;
29 1
    }
30
31 1
    public function getCredentialId(): CredentialId
32
    {
33 1
        return $this->credentialId;
34
    }
35
36 1
    public function getPublicKey(): CoseKeyInterface
37
    {
38 1
        return $this->publicKey;
39
    }
40
41 1
    public function getUserHandle(): UserHandle
42
    {
43 1
        return $this->userHandle;
44
    }
45
}
46