Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | public function findHostnamesByIdentifier(string $identifier, ?string $locale = null): array |
||
43 | { |
||
44 | if (!isset($this->mapping[$identifier])) { |
||
45 | return []; |
||
46 | } |
||
47 | |||
48 | $config = $this->mapping[$identifier]; |
||
49 | |||
50 | if (!\is_string($locale)) { |
||
51 | return $config->getHostnames(); |
||
52 | } |
||
53 | |||
54 | return \in_array($locale, $config->getLocales(), true) ? $config->getHostnames() : []; |
||
55 | } |
||
57 |