CredentialCreationOptions   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPublicKeyOptions() 0 3 1
A setPublicKeyOptions() 0 3 1
A __construct() 0 2 1
A getAsArray() 0 7 2
1
<?php
2
3
namespace MadWizard\WebAuthn\Dom;
4
5
final class CredentialCreationOptions extends AbstractDictionary
6
{
7
    /**
8
     * @var PublicKeyCredentialCreationOptions|null
9
     */
10
    private $publicKey;
11
12 1
    public function __construct()
13
    {
14 1
    }
15
16 1
    public function setPublicKeyOptions(PublicKeyCredentialCreationOptions $options): void
17
    {
18 1
        $this->publicKey = $options;
19 1
    }
20
21
    public function getPublicKeyOptions(): ?PublicKeyCredentialCreationOptions
22
    {
23
        return $this->publicKey;
24
    }
25
26 1
    public function getAsArray(): array
27
    {
28 1
        $map = [];
29 1
        if ($this->publicKey !== null) {
30 1
            $map['publicKey'] = $this->publicKey;
31
        }
32 1
        return $map;
33
    }
34
}
35