Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Pdp\Storage;
use Pdp\TopLevelDomainList;
final class TopLevelDomainsStorage implements TopLevelDomainListStorage
{
public function __construct(
private readonly TopLevelDomainListCache $cache,
private readonly TopLevelDomainListClient $client
) {
}
public function get(string $uri): TopLevelDomainList
{
$topLevelDomains = $this->cache->fetch($uri);
if (null !== $topLevelDomains) {
return $topLevelDomains;
}
$topLevelDomains = $this->client->get($uri);
$this->cache->remember($uri, $topLevelDomains);
return $topLevelDomains;
}
public function delete(string $uri): bool
{
return $this->cache->forget($uri);
}
}