keyed by token */ public function getAll(): array { return $this->cache->get( self::CACHE_KEY, self::TTL, fn (): array => $this->responseMapper->mapCountries($this->apiClient->get('api/countries')), ); } public function get(?string $token): ?Country { if (null === $token) { return null; } return $this->getAll()[$token] ?? null; } }