| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 55.56% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class PublicKeyCredentialParameters extends AbstractDictionary |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Algorithm from COSE. |
||
| 11 | * |
||
| 12 | * @var int |
||
| 13 | */ |
||
| 14 | private $alg; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $type; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * PublicKeyCredentialParameters constructor. |
||
| 23 | * |
||
| 24 | * @param int $alg COSEAlgorithmIdentifier; |
||
| 25 | */ |
||
| 26 | 1 | public function __construct(int $alg, string $type = PublicKeyCredentialType::PUBLIC_KEY) |
|
| 27 | { |
||
| 28 | 1 | if (!PublicKeyCredentialType::isValidType($type)) { |
|
| 29 | throw new WebAuthnException(sprintf('Value %s is not a valid PublicKeyCredentialType.', $type)); |
||
| 30 | } |
||
| 31 | |||
| 32 | 1 | $this->alg = $alg; |
|
| 33 | 1 | $this->type = $type; |
|
| 34 | 1 | } |
|
| 35 | |||
| 36 | public function getAsArray(): array |
||
| 41 | ]; |
||
| 42 | } |
||
| 44 |