CoreFiles by mySites.guru
AuthenticatorGetInfo.php43 lines, 755 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
844f31a501083f1fa75dd07fa6147f43
sha1
bb0ec0e52060c78f84ccf7d9e01d9c750e8f2655
sha256
a2c492b34607d804a68cf9996aad8bcdadd68b1917049a912ffbb146a94be2a7
<?php

declare(strict_types=1);

namespace Webauthn\MetadataService\Statement;

use JsonSerializable;

class AuthenticatorGetInfo implements JsonSerializable
{
    /**
     * @var string[]
     */
    private array $info = [];

    /**
     * @param array<string|int, mixed> $data
     */
    public static function create(array $data = []): self
    {
        $object = new self();
        foreach ($data as $k => $v) {
            $object->add($k, $v);
        }

        return $object;
    }

    public function add(string|int $key, mixed $value): self
    {
        $this->info[$key] = $value;

        return $this;
    }

    /**
     * @return string[]
     */
    public function jsonSerialize(): array
    {
        return $this->info;
    }
}

The same content is in 6 releases, Joomla 5.0.0-alpha1 to 5.0.0-beta2. See them all, or every version of this file.