| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | function menu_path(string $path = ''): string |
||
| 11 | { |
||
| 12 | 45 | $app = Container::getInstance(); |
|
| 13 | |||
| 14 | 45 | $config = $app->make(ConfigRepository::class); |
|
| 15 | |||
| 16 | 45 | $menusDir = $config->get('ussd.menu-path'); |
|
| 17 | |||
| 18 | 45 | $path = $path ? DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR) : $path; |
|
| 19 | |||
| 20 | 45 | return $app->basePath($menusDir.$path); |
|
|
|
|||
| 21 | } |
||
| 23 |