| Total Complexity | 6 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class AuthenticatorAttestationResponse extends AuthenticatorResponse |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $attestationObject; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * AuthenticatorAttestationResponse constructor. |
||
| 25 | * |
||
| 26 | * @param string $clientDataJSON |
||
| 27 | * @param string $attestationObject |
||
| 28 | */ |
||
| 29 | public function __construct(string $clientDataJSON, string $attestationObject) |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param array $json |
||
| 37 | * |
||
| 38 | * @return AuthenticatorAttestationResponse |
||
| 39 | */ |
||
| 40 | public static function createFromJson(array $json): self |
||
| 41 | { |
||
| 42 | if (!array_key_exists('clientDataJSON', $json)) { |
||
| 43 | throw new \InvalidArgumentException(); |
||
| 44 | } |
||
| 45 | if (!array_key_exists('attestationObject', $json)) { |
||
| 46 | throw new \InvalidArgumentException(); |
||
| 47 | } |
||
| 48 | |||
| 49 | return new self( |
||
| 50 | $json['clientDataJSON'], |
||
| 51 | $json['attestationObject'] |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function getAttestationObject(): string |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * {@inheritdoc} |
||
| 65 | */ |
||
| 66 | public function jsonSerialize(): array |
||
| 71 | ]; |
||
| 72 | } |
||
| 74 |