[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/lcobucci/jwt/src/Token/ -> DataSet.php (source)

   1  <?php
   2  
   3  namespace Lcobucci\JWT\Token;
   4  
   5  use function array_key_exists;
   6  
   7  final class DataSet
   8  {
   9      /** @var array<string, mixed> */
  10      private $data;
  11      /** @var string */
  12      private $encoded;
  13  
  14      /**
  15       * @param array<string, mixed> $data
  16       * @param string               $encoded
  17       */
  18      public function __construct(array $data, $encoded)
  19      {
  20          $this->data    = $data;
  21          $this->encoded = $encoded;
  22      }
  23  
  24      /**
  25       * @param string     $name
  26       * @param mixed|null $default
  27       *
  28       * @return mixed|null
  29       */
  30      public function get($name, $default = null)
  31      {
  32          return $this->has($name) ? $this->data[$name] : $default;
  33      }
  34  
  35      /**
  36       * @param string $name
  37       *
  38       * @return bool
  39       */
  40      public function has($name)
  41      {
  42          return array_key_exists($name, $this->data);
  43      }
  44  
  45      /** @return array<string, mixed> */
  46      public function all()
  47      {
  48          return $this->data;
  49      }
  50  
  51      /** @return string */
  52      public function toString()
  53      {
  54          return $this->encoded;
  55      }
  56  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer