Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class SitemapProviders |
||
8 | { |
||
9 | /** @var SitemapProviderInterface[] */ |
||
10 | private $sitemapProviders = []; |
||
11 | |||
12 | public function add(SitemapProviderInterface $sitemapProvider): void |
||
13 | { |
||
14 | $this->sitemapProviders[$sitemapProvider->getKey()] = $sitemapProvider; |
||
15 | } |
||
16 | |||
17 | public function exists(string $sitemapProviderKey): bool |
||
18 | { |
||
19 | return array_key_exists($sitemapProviderKey, $this->sitemapProviders); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param string $sitemapProviderKey |
||
24 | * @return SitemapProviderInterface |
||
25 | * @throws SitemapException |
||
26 | */ |
||
27 | public function get(string $sitemapProviderKey): SitemapProviderInterface |
||
34 | } |
||
35 | |||
36 | public function getAll(): array |
||
37 | { |
||
38 | return $this->sitemapProviders; |
||
39 | } |
||
40 | |||
41 | public function getKeys(): array |
||
44 | } |
||
45 | } |
||
46 |