Issues (33)

src/Support/helpers.php (1 issue)

Severity
1
<?php
2
3
use Illuminate\Container\Container;
4
use Illuminate\Contracts\Config\Repository as ConfigRepository;
5
6
if (! function_exists('menu_path')) {
7
    /**
8
     * Get the path to the menus directory.
9
     */
10
    function menu_path(string $path = ''): string
11
    {
12 49
        $app = Container::getInstance();
13
14 49
        $config = $app->make(ConfigRepository::class);
15
16 49
        $menusDir = $config->get('ussd.menu-path');
17
18 49
        $path = $path ? DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR) : $path;
19
20 49
        return $app->basePath($menusDir.$path);
0 ignored issues
show
The method basePath() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        return $app->/** @scrutinizer ignore-call */ basePath($menusDir.$path);
Loading history...
21
    }
22
}
23