RegistrationRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 31
ccs 8
cts 10
cp 0.8
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getClientOptionsJson() 0 3 1
A getContext() 0 3 1
A getClientOptions() 0 3 1
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