Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940<?php
declare(strict_types=1);
namespace Wotnak\Atproto\Identity;
/** * AT Protocol service endpoint from a DID document. * * @api */final readonly class AtprotoServiceEndpoint {
/** * @param array<string, mixed> $raw */ public function __construct( public string $id, public string $type, public string $serviceEndpoint, public array $raw = [], ) {}
/** * Parses a service endpoint from DID document data. * * @param array<string, mixed> $service */ public static function fromArray(array $service): ?self { if (!\is_string($service['id'] ?? NULL) || !\is_string($service['type'] ?? NULL)) { return NULL; } if (!\is_string($service['serviceEndpoint'] ?? NULL)) { return NULL; } return new self($service['id'], $service['type'], $service['serviceEndpoint'], $service); }
}