Total Complexity | 7 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity |
||
10 | { |
||
11 | /** |
||
12 | * @var string|null |
||
13 | */ |
||
14 | private $id; |
||
15 | |||
16 | /** |
||
17 | * PublicKeyCredentialRpEntity constructor. |
||
18 | * |
||
19 | * @param string|null $id Relying party ID (valid domain string) |
||
20 | * |
||
21 | * @throws WebAuthnException |
||
22 | */ |
||
23 | 9 | public function __construct(string $name, ?string $id = null) |
|
32 | } |
||
33 | 8 | } |
|
34 | |||
35 | 4 | public function getId(): ?string |
|
36 | { |
||
37 | 4 | return $this->id; |
|
38 | } |
||
39 | |||
40 | 7 | public function getAsArray(): array |
|
41 | { |
||
42 | 7 | $map = parent::getAsArray(); |
|
43 | 7 | if ($this->id !== null) { |
|
44 | 2 | $map['id'] = $this->id; |
|
45 | } |
||
46 | 7 | return $map; |
|
47 | } |
||
48 | |||
49 | 3 | public static function fromRelyingParty(RelyingPartyInterface $rp): self |
|
54 | } |
||
55 | } |
||
56 |