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