| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2.004 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 2 | public function find($path, array $locales, $translationDirectory = null) |
|
| 33 | { |
||
| 34 | 2 | $finder = new Finder(); |
|
| 35 | 2 | $translationDirectory = $translationDirectory ?? $this->defaultTranslationFolder; |
|
| 36 | |||
| 37 | 2 | $exploreDir = $path . '/' . $translationDirectory; |
|
| 38 | |||
| 39 | 2 | if (is_dir($exploreDir)) { |
|
| 40 | 2 | $finder->files() |
|
| 41 | 2 | ->name(sprintf('/(.*(%s)\.(%s))/', implode('|', $locales), implode('|', $this->fileFormats))) |
|
| 42 | 2 | ->in($exploreDir); |
|
| 43 | |||
| 44 | 2 | return $finder; |
|
| 45 | } |
||
| 46 | |||
| 47 | throw new TranslationsNotFoundException('Directory `' . $exploreDir . '` does not exist, translations could not be found.'); |
||
| 48 | } |
||
| 49 | |||
| 55 |