AuthenticationRequest::getClientOptionsJson()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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