| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function toArray(string $translationsDirectory): array |
||
| 16 | { |
||
| 17 | $domains = []; |
||
| 18 | $finder = new Finder(); |
||
| 19 | foreach ($finder->in($translationsDirectory) as $item) { |
||
| 20 | $itemName = $item->getFilename(); |
||
| 21 | $explodedName = explode('.', $itemName); |
||
| 22 | if (!array_key_exists(0, $explodedName) || $explodedName[0] === $itemName) { |
||
| 23 | continue; |
||
| 24 | } |
||
| 25 | |||
| 26 | $domainName = $explodedName[0]; |
||
| 27 | if (!in_array($domainName, $domains)) { |
||
| 28 | $domains[] = $domainName; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | return $domains; |
||
| 33 | } |
||
| 35 |