CredentialCreationOptions::getAsArray()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 4
c 1
b 1
f 0
nc 2
nop 0
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 2
rs 10
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