type; } /** * @deprecated since 4.7.0. Please use the property directly. * @infection-ignore-all */ public function getId(): string { return $this->id; } /** * @return string[] * @deprecated since 4.7.0. Please use the property directly. * @infection-ignore-all */ public function getTransports(): array { return $this->transports; } /** * @deprecated since 4.9.0 and will be removed in 5.0.0. Please use the serializer instead. */ public static function createFromString(string $data): self { $data = json_decode($data, true, flags: JSON_THROW_ON_ERROR); return self::createFromArray($data); } /** * @param mixed[] $json * @deprecated since 4.9.0 and will be removed in 5.0.0. Please use the serializer instead. */ public static function createFromArray(array $json): self { array_key_exists('type', $json) || throw InvalidDataException::create( $json, 'Invalid input. "type" is missing.' ); array_key_exists('id', $json) || throw InvalidDataException::create($json, 'Invalid input. "id" is missing.'); $id = Base64UrlSafe::decodeNoPadding($json['id']); return self::create($json['type'], $id, $json['transports'] ?? []); } /** * @return mixed[] */ public function jsonSerialize(): array { trigger_deprecation( 'web-auth/webauthn-bundle', '4.9.0', 'The "%s" method is deprecated and will be removed in 5.0. Please use the serializer instead.', __METHOD__ ); $json = [ 'type' => $this->type, 'id' => Base64UrlSafe::encodeUnpadded($this->id), ]; if (count($this->transports) !== 0) { $json['transports'] = $this->transports; } return $json; } }