domain_path()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
use Illuminate\Foundation\Vite;
4
use Illuminate\Support\Facades\Vite as ViteFacade;
5
6
if (! function_exists('domain_path')) {
7
    function domain_path($name, $path = '')
8
    {
9
        $domain = app('domains')->find($name);
10
11
        return $domain->getPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);
12
    }
13
}
14
15
if (! function_exists('config_path')) {
16
    /**
17
     * Get the configuration path.
18
     *
19
     * @param  string $path
20
     * @return string
21
     */
22
    function config_path($path = '')
23
    {
24
        return app()->basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $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

24
        return app()->/** @scrutinizer ignore-call */ basePath() . '/config' . ($path ? DIRECTORY_SEPARATOR . $path : $path);
Loading history...
25
    }
26
}
27
28
if (! function_exists('public_path')) {
29
    /**
30
     * Get the path to the public folder.
31
     *
32
     * @param  string  $path
33
     * @return string
34
     */
35
    function public_path($path = '')
36
    {
37
        return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
38
    }
39
}
40
41
if (! function_exists('domain_vite')) {
42
    /**
43
     * support for vite
44
     */
45
    function domain_vite($domain, $asset): Vite
46
    {
47
        return ViteFacade::useHotFile(storage_path('vite.hot'))->useBuildDirectory($domain)->withEntryPoints([$asset]);
0 ignored issues
show
Bug introduced by
The method useBuildDirectory() does not exist on Illuminate\Support\Facades\Vite. ( Ignorable by Annotation )

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

47
        return ViteFacade::useHotFile(storage_path('vite.hot'))->/** @scrutinizer ignore-call */ useBuildDirectory($domain)->withEntryPoints([$asset]);

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...
48
    }
49
}
50