NameResolver::makeConfigFileName()   A
last analyzed

Complexity

Conditions 1
Paths 1

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 1
nc 1
nop 1
1
<?php
2
3
namespace LaravelPropertyBag\Helpers;
4
5
use Illuminate\Container\Container;
6
7
class NameResolver
8
{
9
    /**
10
     * Get the app namespace from the container.
11
     *
12
     * @return string
13
     */
14
    public static function getAppNamespace()
15
    {
16
        return Container::getInstance()->getNamespace();
0 ignored issues
show
introduced by
The method getNamespace() 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

16
        return Container::getInstance()->/** @scrutinizer ignore-call */ getNamespace();
Loading history...
17
    }
18
19
    /**
20
     * Make config file name for resource.
21
     *
22
     * @param string $resourceName
23
     *
24
     * @return string
25
     */
26
    public static function makeConfigFileName($resourceName)
27
    {
28
        $appNamespace = static::getAppNamespace();
29
30
        return $appNamespace.'Settings\\'.$resourceName.'Settings';
31
    }
32
33
    /**
34
     * Make rules file name.
35
     *
36
     * @return string
37
     */
38
    public static function makeRulesFileName()
39
    {
40
        $appNamespace = static::getAppNamespace();
41
42
        return $appNamespace.'Settings\\Resources\\Rules';
43
    }
44
}
45