config_path()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 2
nc 2
nop 1
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
introduced by
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);
0 ignored issues
show
Bug introduced by
The method find() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

14
        $module = app('modules')->/** @scrutinizer ignore-call */ find($name);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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