Passed
Push — master ( 6c8be3...a97a6e )
by Bruno
03:44
created

Modelarium   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

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

4 Methods

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