CoreFiles by mySites.guru
DataSet.php56 lines, 1,047 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
9fa4389d4d201705b515ccc9be20623a
sha1
013a205a66c7b1532698554ec7435bc974809341
sha256
50c4beef2fc23fdb489e718d6dd6c7b200dba4b38f656706b9a4d7c967c152b8
<?php

namespace Lcobucci\JWT\Token;

use function array_key_exists;

final class DataSet
{
    /** @var array<string, mixed> */
    private $data;
    /** @var string */
    private $encoded;

    /**
     * @param array<string, mixed> $data
     * @param string               $encoded
     */
    public function __construct(array $data, $encoded)
    {
        $this->data    = $data;
        $this->encoded = $encoded;
    }

    /**
     * @param string     $name
     * @param mixed|null $default
     *
     * @return mixed|null
     */
    public function get($name, $default = null)
    {
        return $this->has($name) ? $this->data[$name] : $default;
    }

    /**
     * @param string $name
     *
     * @return bool
     */
    public function has($name)
    {
        return array_key_exists($name, $this->data);
    }

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

    /** @return string */
    public function toString()
    {
        return $this->encoded;
    }
}

The same content is in 75 releases, Joomla 4.2.0-beta3 to 4.4.14. See them all, or every version of this file.