__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace Webauthn;
use function array_key_exists;
use Webauthn\Exception\InvalidDataException;
class PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity
{
public function __construct(
string $name,
protected ?string $id = null,
?string $icon = null
) {
parent::__construct($name, $icon);
}
public static function create(string $name, ?string $id = null, ?string $icon = null): self
{
return new self($name, $id, $icon);
}
public function getId(): ?string
{
return $this->id;
}
/**
* @param mixed[] $json
*/
public static function createFromArray(array $json): self
{
array_key_exists('name', $json) || throw InvalidDataException::create(
$json,
'Invalid input. "name" is missing.'
);
return new self($json['name'], $json['id'] ?? null, $json['icon'] ?? null);
}
/**
* @return mixed[]
*/
public function jsonSerialize(): array
{
$json = parent::jsonSerialize();
if ($this->id !== null) {
$json['id'] = $this->id;
}
return $json;
}
}