CoreFiles by mySites.guru
AlternativeDescriptions.php54 lines, 997 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
b9b2cc1df9cc08d2820d8ef6f27cad9e
sha1
55ce36525b805d249045eb9f07e7ca0c12429c49
sha256
1ab6f2aab76ac4b1d89aefc1e651a86b756f4898a1a564afc186c2d4b24667be
<?php

declare(strict_types=1);

namespace Webauthn\MetadataService\Statement;

use JsonSerializable;

/**
 * @final
 */
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 152 releases, Joomla 5.0.0-beta3 to 6.3.0-alpha1. See them all, or every version of this file.