getCachedTldList(); if (!$item->isHit()) { $supportedTldList = $this->getSupportedTldList(); $item ->set($supportedTldList) ->expiresAfter(new \DateInterval('PT1H')); $this->cacheItemPool->saveDeferred($item); } else { $supportedTldList = $item->get(); } $extensionList = []; foreach ($domainList as $domain) { // We want to check the support of TLDs and SLDs here. // For example, it is not enough for the Connector to support .fr for it to support the domain name example.asso.fr. // It must support .asso.fr. $extension = explode('.', $domain->getLdhName(), 2)[1]; if (!in_array($extension, $extensionList)) { $extensionList[] = $extension; } } foreach ($extensionList as $extension) { if (!in_array($extension, $supportedTldList)) { return false; } } return true; } public function authenticate(array $authData): void { $this->authData = $authData; } abstract protected function getCachedTldList(): CacheItemInterface; abstract protected function getSupportedTldList(): array; }