GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Layer::getTestsDir()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace DDDGen\VO;
5
6
use Assert\Assert;
7
8
final class Layer
9
{
10
    /** @var  string */
11
    private $name;
12
    /** @var  FQCN */
13
    private $src_fqcn;
14
    /** @var  string */
15
    private $src_dir;
16
    /** @var  FQCN */
17
    private $tests_fqcn;
18
    /** @var  string */
19
    private $tests_dir;
20
    
21
    /**
22
     * Layer constructor.
23
     *
24
     * @param string $name
25
     * @param FQCN   $src_fqcn
26
     * @param string $src_dir
27
     * @param FQCN   $tests_fqcn
28
     * @param string $tests_dir
29
     */
30 4
    public function __construct($name, FQCN $src_fqcn, $src_dir, FQCN $tests_fqcn, $tests_dir)
31
    {
32 4
        $this->name       = $name;
33 4
        $this->src_fqcn   = $src_fqcn;
34 4
        $this->src_dir    = $src_dir;
35 4
        $this->tests_fqcn = $tests_fqcn;
36 4
        $this->tests_dir  = $tests_dir;
37
        
38 4
        $this->validate();
39 3
    }
40
    
41
    
42
    /**
43
     * @return string
44
     */
45 3
    public function getName(): string
46
    {
47 3
        return $this->name;
48
    }
49
    
50
    /**
51
     * @return FQCN
52
     */
53 3
    public function getSrcFqcn(): FQCN
54
    {
55 3
        return $this->src_fqcn;
56
    }
57
    
58
    /**
59
     * @return string
60
     */
61 3
    public function getSrcDir(): string
62
    {
63 3
        return $this->src_dir;
64
    }
65
    
66
    /**
67
     * @return FQCN
68
     */
69 3
    public function getTestsFqcn(): FQCN
70
    {
71 3
        return $this->tests_fqcn;
72
    }
73
    
74
    /**
75
     * @return string
76
     */
77 3
    public function getTestsDir(): string
78
    {
79 3
        return $this->tests_dir;
80
    }
81
    
82
    
83
    
84
    
85 4
    private function validate()
86
    {
87 4
        Assert::that($this->name)->inArray(['app', 'domain', 'infrastructure'],
88 4
            'Only 3 layers supported - app, domain or infrastructure');
89 3
        Assert::thatAll([$this->src_dir, $this->tests_dir])->minLength(1);
90 3
    }
91
    
92
}