Passed
Push — union-types ( b56600 )
by Luis
14:03
created

GeneratorInput   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A directory() 0 3 1
A __construct() 0 5 1
A display() 0 3 1
A outputFile() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * PHP version 7.4
4
 *
5
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
6
 */
7
8
namespace PhUml\Console\Commands;
9
10
use PhUml\Parser\CodebaseDirectory;
11
use PhUml\Processors\OutputFilePath;
12
use PhUml\Stages\ProgressDisplay;
13
14
final class GeneratorInput
15
{
16
    private CodebaseDirectory $directory;
17
18
    private OutputFilePath $outputFile;
19
20
    private ProgressDisplay $display;
21
22
    /** @param string[] $input */
23
    public function __construct(array $input, ProgressDisplay $display)
24
    {
25
        $this->directory = new CodebaseDirectory($input['directory'] ?? '');
26
        $this->outputFile = new OutputFilePath($input['output'] ?? '');
27
        $this->display = $display;
28
    }
29
30
    public function outputFile(): OutputFilePath
31
    {
32
        return $this->outputFile;
33
    }
34
35
    public function directory(): CodebaseDirectory
36
    {
37
        return $this->directory;
38
    }
39
40
    public function display(): ProgressDisplay
41
    {
42
        return $this->display;
43
    }
44
}
45