Total Complexity | 7 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 70.59% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | final class PublicKeyCredential implements PublicKeyCredentialInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var ByteBuffer |
||
11 | */ |
||
12 | private $rawId; |
||
13 | |||
14 | /** |
||
15 | * @var AuthenticatorResponseInterface |
||
16 | */ |
||
17 | private $response; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $clientExtensionResults = []; |
||
23 | |||
24 | 16 | public function __construct(ByteBuffer $rawCredentialId, AuthenticatorResponseInterface $response) |
|
25 | { |
||
26 | 16 | $this->rawId = $rawCredentialId; |
|
27 | 16 | $this->response = $response; |
|
28 | 16 | } |
|
29 | |||
30 | public function getType(): string |
||
31 | { |
||
32 | return PublicKeyCredentialType::PUBLIC_KEY; |
||
33 | } |
||
34 | |||
35 | 12 | public function getRawId(): ByteBuffer |
|
36 | { |
||
37 | 12 | return $this->rawId; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * The credential's identifier. For public key credentials this is a base64url encoded version of the raw credential ID. |
||
42 | */ |
||
43 | 1 | public function getId(): string |
|
44 | { |
||
45 | 1 | return $this->rawId->getBase64Url(); |
|
46 | } |
||
47 | |||
48 | 16 | public function getResponse(): AuthenticatorResponseInterface |
|
49 | { |
||
50 | 16 | return $this->response; |
|
51 | } |
||
52 | |||
53 | public function setClientExtensionResults(array $extensionResults): void |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return array Array of client extensions as provided by the client (no parsing done yet) |
||
60 | */ |
||
61 | 12 | public function getClientExtensionResults(): array |
|
64 | } |
||
65 | } |
||
66 |