Conditions | 4 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 4 | protected function separateModule(array $path, ?string $emptyDefault = null): array |
|
26 | { |
||
27 | 4 | if (empty($path)) { |
|
28 | 1 | throw new ModuleException($this->getMdLang()->mdNoModuleFound()); |
|
29 | } |
||
30 | |||
31 | 3 | $target = strval(reset($path)); |
|
32 | 3 | $constructPath = is_null($emptyDefault) ? $target : $emptyDefault ; |
|
33 | |||
34 | 3 | if (1 < count($path)) { |
|
35 | 2 | $constructPath = implode('\\', array_slice($path, 1)); |
|
36 | } |
||
37 | |||
38 | 3 | return [$target, $constructPath]; |
|
39 | } |
||
41 |