[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/web-auth/metadata-service/src/ -> MetadataTOCPayload.php (source)

   1  <?php
   2  
   3  declare(strict_types=1);
   4  
   5  /*
   6   * The MIT License (MIT)
   7   *
   8   * Copyright (c) 2014-2019 Spomky-Labs
   9   *
  10   * This software may be modified and distributed under the terms
  11   * of the MIT license.  See the LICENSE file for details.
  12   */
  13  
  14  namespace Webauthn\MetadataService;
  15  
  16  class MetadataTOCPayload
  17  {
  18      /**
  19       * @var string|null
  20       */
  21      private $legalHeader;
  22  
  23      /**
  24       * @var int
  25       */
  26      private $no;
  27  
  28      /**
  29       * @var string
  30       */
  31      private $nextUpdate;
  32  
  33      /**
  34       * @var MetadataTOCPayloadEntry[]
  35       */
  36      private $entries = [];
  37  
  38      public function getLegalHeader(): ?string
  39      {
  40          return $this->legalHeader;
  41      }
  42  
  43      public function getNo(): int
  44      {
  45          return $this->no;
  46      }
  47  
  48      public function getNextUpdate(): string
  49      {
  50          return $this->nextUpdate;
  51      }
  52  
  53      /**
  54       * @return MetadataTOCPayloadEntry[]
  55       */
  56      public function getEntries(): array
  57      {
  58          return $this->entries;
  59      }
  60  
  61      public static function createFromArray(array $data): self
  62      {
  63          $object = new self();
  64          $object->legalHeader = $data['legalHeader'] ?? null;
  65          $object->nextUpdate = $data['nextUpdate'] ?? null;
  66          $object->no = $data['no'] ?? null;
  67          $object->entries = [];
  68          if (isset($data['entries'])) {
  69              foreach ($data['entries'] as $k => $entry) {
  70                  $object->entries[$k] = MetadataTOCPayloadEntry::createFromArray($entry);
  71              }
  72          }
  73  
  74          return $object;
  75      }
  76  }


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