choice( PublicKeyCredentialType::ALL, 'type "%s" is not an element of the valid values: %s' ); Assert::thatAll( $transports )->string() ->notBlank( 'transports item "%s" is blank, but was expected to contain a value.' ); $this->type = $type; $this->id = $id; $this->transports = $transports; } public static function hydrate( array $data ): self { Assert::that( $data, 'PublicKeyCredentialDescriptor hydration does not contain "%s".' ) ->keyExists( 'type' ) ->keyExists( 'id' ) ->keyExists( 'transports' ); return new self( $data['type'], BinaryString::from_ascii_fast( $data['id'] ), $data['transports'] ); } public function get_type(): string { return $this->type; } public function get_id(): BinaryString { return $this->id; } public function get_transports(): array { return $this->transports; } public function jsonSerialize(): array { return \ITSEC_Lib::recursively_json_serialize( get_object_vars( $this ) ); } }