RegistrationRequest::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace MadWizard\WebAuthn\Server\Registration;
4
5
use MadWizard\WebAuthn\Dom\PublicKeyCredentialCreationOptions;
6
use MadWizard\WebAuthn\Json\JsonConverter;
7
8
final class RegistrationRequest
9
{
10
    /**
11
     * @var PublicKeyCredentialCreationOptions
12
     */
13
    private $creationOptions;
14
15
    /**
16
     * @var RegistrationContext
17
     */
18
    private $context;
19
20 1
    public function __construct(PublicKeyCredentialCreationOptions $creationOptions, RegistrationContext $context)
21
    {
22 1
        $this->creationOptions = $creationOptions;
23 1
        $this->context = $context;
24 1
    }
25
26 1
    public function getClientOptions(): PublicKeyCredentialCreationOptions
27
    {
28 1
        return $this->creationOptions;
29
    }
30
31
    public function getClientOptionsJson(): array
32
    {
33
        return JsonConverter::encodeDictionary($this->creationOptions);
34
    }
35
36 1
    public function getContext(): RegistrationContext
37
    {
38 1
        return $this->context;
39
    }
40
}
41