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

GeneratorInput::setOutputFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
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