Passed
Pull Request — master (#18)
by
unknown
08:11
created

CredentialRequestOptions   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

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