__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php

declare(strict_types=1);

namespace Webauthn\MetadataService\Service;

use function array_key_exists;
use function is_array;
use function is_int;
use function is_string;
use JsonSerializable;
use Webauthn\MetadataService\Exception\MetadataStatementLoadingException;
use Webauthn\MetadataService\Utils;

/**
 * @final
 */
class MetadataBLOBPayload implements JsonSerializable
{
    /**
     * @var MetadataBLOBPayloadEntry[]
     */
    private array $entries = [];

    /**
     * @var string[]
     */
    private array $rootCertificates = [];

    public function __construct(
        private readonly int $no,
        private readonly string $nextUpdate,
        private readonly ?string $legalHeader = null
    ) {
    }

    public function addEntry(MetadataBLOBPayloadEntry $entry): self
    {
        $this->entries[] = $entry;

        return $this;
    }

    public function getLegalHeader(): ?string
    {
        return $this->legalHeader;
    }

    public function getNo(): int
    {
        return $this->no;
    }

    public function getNextUpdate(): string
    {
        return $this->nextUpdate;
    }

    /**
     * @return MetadataBLOBPayloadEntry[]
     */
    public function getEntries(): array
    {
        return $this->entries;
    }

    /**
     * @param array<string, mixed> $data
     */
    public static function createFromArray(array $data): self
    {
        $data = Utils::filterNullValues($data);
        foreach (['no', 'nextUpdate', 'entries'] as $key) {
            array_key_exists($key, $data) || throw MetadataStatementLoadingException::create(sprintf(
                'Invalid data. The parameter "%s" is missing',
                $key
            ));
        }
        is_int($data['no']) || throw MetadataStatementLoadingException::create(
            'Invalid data. The parameter "no" shall be an integer'
        );
        is_string($data['nextUpdate']) || throw MetadataStatementLoadingException::create(
            'Invalid data. The parameter "nextUpdate" shall be a string'
        );
        is_array($data['entries']) || throw MetadataStatementLoadingException::create(
            'Invalid data. The parameter "entries" shall be a n array of entries'
        );
        $object = new self($data['no'], $data['nextUpdate'], $data['legalHeader'] ?? null);
        foreach ($data['entries'] as $entry) {
            $object->addEntry(MetadataBLOBPayloadEntry::createFromArray($entry));
        }

        return $object;
    }

    /**
     * @return array<string, mixed>
     */
    public function jsonSerialize(): array
    {
        $data = [
            'legalHeader' => $this->legalHeader,
            'nextUpdate' => $this->nextUpdate,
            'no' => $this->no,
            'entries' => array_map(
                static fn (MetadataBLOBPayloadEntry $object): array => $object->jsonSerialize(),
                $this->entries
            ),
        ];

        return Utils::filterNullValues($data);
    }

    /**
     * @return string[]
     */
    public function getRootCertificates(): array
    {
        return $this->rootCertificates;
    }

    /**
     * @param string[] $rootCertificates
     */
    public function setRootCertificates(array $rootCertificates): self
    {
        $this->rootCertificates = $rootCertificates;

        return $this;
    }
}

Filemanager

Name Type Size Permission Actions
ChainedMetadataServices.php File 1.49 KB 0664
DistantResourceMetadataService.php File 4.16 KB 0664
FidoAllianceCompliantMetadataService.php File 7.8 KB 0664
FolderResourceMetadataService.php File 1.86 KB 0664
InMemoryMetadataService.php File 2.03 KB 0664
LocalResourceMetadataService.php File 2.76 KB 0664
MetadataBLOBPayload.php File 3.26 KB 0664
MetadataBLOBPayloadEntry.php File 6.33 KB 0664
MetadataService.php File 398 B 0664
StringMetadataService.php File 2.04 KB 0664
Filemanager