Conditions | 5 |
Paths | 8 |
Total Lines | 6 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 31 | public function link(array $path, array $module = [], bool $moduleSingle = false, ?string $user = null): string |
|
34 | { |
||
35 | 31 | $prefix = !empty($this->prefix) ? Stuff::canonize($this->prefix) . IPaths::SPLITTER_SLASH : ''; |
|
36 | 31 | $modulePath = !empty($module) ? [Support::prefixWithSeparator($moduleSingle ? Support::PREFIX_MOD_SINGLE : Support::PREFIX_MOD_NORMAL) . Support::requestFromModuleName($module)] : []; |
|
37 | 31 | $userPath = !empty($user) ? [Support::prefixWithSeparator(Support::PREFIX_USER) . $user] : []; |
|
38 | 31 | return $prefix . strval(implode(IPaths::SPLITTER_SLASH, array_filter(array_merge($modulePath, $userPath, $path)))); |
|
39 | } |
||
41 |