Passed
Push — develop ( 45600c...ff69f6 )
by Paul
03:16
created

DirectoryModel   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
dl 0
loc 63
c 0
b 0
f 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setSourceDirectory() 0 3 1
A addPhpFile() 0 3 1
A getTargetDirectory() 0 3 1
A setTargetDirectory() 0 3 1
A getPhpFiles() 0 3 1
A getSourceDirectory() 0 3 1
1
<?php
2
3
namespace PhpUnitGen\Model;
4
5
use PhpUnitGen\Model\ModelInterface\DirectoryModelInterface;
6
use PhpUnitGen\Model\ModelInterface\PhpFileModelInterface;
7
8
/**
9
 * Class DirectoryModel.
10
 *
11
 * @author     Paul Thébaud <[email protected]>.
12
 * @copyright  2017-2018 Paul Thébaud <[email protected]>.
13
 * @license    https://opensource.org/licenses/MIT The MIT license.
14
 * @link       https://github.com/paul-thebaud/phpunit-generator
15
 * @since      Class available since Release 2.0.0.
16
 */
17
class DirectoryModel implements DirectoryModelInterface
18
{
19
    /**
20
     * @var string $sourceDirectory The source directory (contains php files to parse).
21
     */
22
    private $sourceDirectory;
23
24
    /**
25
     * @var string $targetDirectory The target directory (will contains generated tests files).
26
     */
27
    private $targetDirectory;
28
29
    /**
30
     * @var PhpFileModel[] $phpFiles Php files contained in the directory (and sub directories).
31
     */
32
    private $phpFiles = [];
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function setSourceDirectory(string $sourceDirectory): void
38
    {
39
        $this->sourceDirectory = $sourceDirectory;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getSourceDirectory(): string
46
    {
47
        return $this->sourceDirectory;
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function setTargetDirectory(string $targetDirectory): void
54
    {
55
        $this->targetDirectory = $targetDirectory;
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function getTargetDirectory(): string
62
    {
63
        return $this->targetDirectory;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function addPhpFile(PhpFileModelInterface $phpFile): void
70
    {
71
        $this->phpFiles[] = $phpFile;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getPhpFiles(): array
78
    {
79
        return $this->phpFiles;
80
    }
81
}