Lines: 100.00%
| Line | Hits | Source |
|---|---|---|
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Drupal\visitors\Service; | |
| 6 | ||
| 7 | use Drupal\visitors\VisitorsAiAssistantsInterface; | |
| 8 | ||
| 9 | /** | |
| 10 | * Service for matching hostnames to AI assistants. | |
| 11 | */ | |
| 12 | final class AiAssistantsService extends HostnameMatcherServiceBase implements VisitorsAiAssistantsInterface { | |
| 13 | ||
| 14 | /** | |
| 15 | * {@inheritdoc} | |
| 16 | */ | |
| 17 | protected function getConfig(): array { | |
| 18 | 10 | if ($this->cachedConfig === NULL) { |
| 19 | 10 | $config = $this->configFactory->get('visitors.ai_assistants'); |
| 20 | 10 | $this->cachedConfig = $config->get('sites') ?? []; |
| 21 | } | |
| 22 | ||
| 23 | 10 | return $this->cachedConfig; |
| 24 | } | |
| 25 | ||
| 26 | } |