Modelarium   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 13
c 2
b 0
f 0
dl 0
loc 53
ccs 5
cts 15
cp 0.3333
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A registerDirectiveLaravelLibrary() 0 3 1
A getGeneratorDirectiveNamespaces() 0 7 1
A getDirectiveLaravelLibraries() 0 3 1
A getGeneratorLighthouseDirectiveNamespaces() 0 7 1
1
<?php declare(strict_types=1);
2
3
namespace Modelarium;
4
5
final class Modelarium
6
{
7
    /**
8
     * Namespaces for base laravel libraries
9
     *
10
     * @var string[]
11
     */
12
    protected static $directiveLaravelLibraries = [
13
        'Modelarium'
14
    ];
15
16
    /**
17
     * Register a library that provides Laravel directives.
18
     *
19
     * @param string $ns
20
     * @return void
21
     */
22
    public static function registerDirectiveLaravelLibrary(string $ns): void
23
    {
24
        self::$directiveLaravelLibraries[] = $ns;
25
    }
26
27
    public static function getDirectiveLaravelLibraries(): array
28
    {
29
        return self::$directiveLaravelLibraries;
30
    }
31
32
    /**
33
     * Directive namespaces
34
     * @return string[] The list of directive namespaces
35
     */
36 19
    public static function getGeneratorDirectiveNamespaces(): array
37
    {
38 19
        return array_map(
39
            function ($i) {
40 19
                return $i . '\\Laravel\\Directives';
41 19
            },
42 19
            self::$directiveLaravelLibraries
43
        );
44
    }
45
46
    /**
47
     * Lighthouse directive namespaces
48
     *
49
     * @return string[]
50
     */
51
    public static function getGeneratorLighthouseDirectiveNamespaces(): array
52
    {
53
        return array_map(
54
            function ($i) {
55
                return $i . '\\Laravel\\Lighthouse\\Directives';
56
            },
57
            self::$directiveLaravelLibraries
58
        );
59
    }
60
}
61