Issues (65)

src/helpers.php (1 issue)

1
<?php
2
3
if (! function_exists('config_path')) {
4
    function config_path(string $path = ''): string
5
    {
6
        return app()->basePath() . '/config' . ($path ? "/{$path}" : $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

6
        return app()->/** @scrutinizer ignore-call */ basePath() . '/config' . ($path ? "/{$path}" : $path);
Loading history...
7
    }
8
}
9
10
if (! function_exists('module_path')) {
11
    function module_path(string $name): string
12
    {
13
        /** @var \Rawilk\LaravelModules\Module $module */
14
        $module = app('modules')->find($name);
15
16
        return $module->getPath();
17
    }
18
}
19
20
if (! function_exists('public_path')) {
21
    function public_path(string $path = ''): string
22
    {
23
        return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
24
    }
25
}
26