| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 15 | public function load(string $lang): array |
|
| 24 | { |
||
| 25 | 15 | $directories = []; |
|
| 26 | |||
| 27 | 15 | foreach (Finder::find('*.*.neon')->from($this->directories) as $file) { |
|
|
|
|||
| 28 | 15 | if (!preg_match('~^(?P<prefix>.*?)\.(?P<lang>[^\.]+)\.(?P<format>[^\.]+)$~', $file->getFilename(), $matches)) { |
|
| 29 | continue; |
||
| 30 | } |
||
| 31 | |||
| 32 | 15 | $resource = new NeonResource($file->getPathname(), $matches['lang'], in_array($matches['prefix'], $this->ignoredPrefixes) ? '' : $matches['prefix'] . '.'); |
|
| 33 | 15 | $directories = array_merge($directories, $resource->load($lang)); |
|
| 34 | } |
||
| 35 | |||
| 36 | 15 | return $directories; |
|
| 37 | } |
||
| 39 |