Conditions | 3 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | 9 | public function __construct(string $name, ?string $id = null) |
|
24 | { |
||
25 | 9 | parent::__construct($name); |
|
26 | 9 | if ($id !== null) { |
|
27 | 3 | $id = filter_var($id, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME); |
|
28 | 3 | if ($id === false) { |
|
29 | 1 | throw new WebAuthnException('Invalid domain name'); |
|
30 | } |
||
31 | 2 | $this->id = $id; |
|
32 | } |
||
56 |