CoreFiles by mySites.guru
AlternativeDescriptions.php51 lines, 979 bytes, from Joomla_5.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta1
md5
6c9bca69ba7008890d233bdf62ebb602
sha1
7aaf6539529793877e8dca0c63b3d0ee0d637033
sha256
af47250f50fc31cda97f6fefed277cf2a091215869a184b5ddec9db5d5f93976
<?php

declare(strict_types=1);

namespace Webauthn\MetadataService\Statement;

use JsonSerializable;

class AlternativeDescriptions implements JsonSerializable
{
    /**
     * @var array<string, string>
     */
    private array $descriptions = [];

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

        return $object;
    }

    /**
     * @return array<string, string>
     */
    public function all(): array
    {
        return $this->descriptions;
    }

    public function add(string $locale, string $description): self
    {
        $this->descriptions[$locale] = $description;

        return $this;
    }

    /**
     * @return array<string, string>
     */
    public function jsonSerialize(): array
    {
        return $this->descriptions;
    }
}

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.