Test Failed
Pull Request — master (#74)
by Peter
12:33 queued 05:48
created

InputSettingData::getPathToCacheDir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
ccs 0
cts 0
cp 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace YamlStandards\Command;
6
7
use Symfony\Component\Console\Input\InputInterface;
8
9
class InputSettingData
10
{
11
    /**
12
     * @var string
13
     */
14
    private $pathToConfigFile;
15
16
    /**
17
     * @var bool
18
     */
19
    private $fixEnabled;
20
21
    /**
22
     * @var string
23
     */
24 10
    private $pathToCacheDir;
25
26
    /**
27 10
     * @var bool
28 10
     */
29 10
    private $disableCache;
30
31
    /**
32
     * @param \Symfony\Component\Console\Input\InputInterface $input
33
     */
34
    public function __construct(InputInterface $input)
35 10
    {
36
        /** @var string $pathToConfigFile */
37 10
        $pathToConfigFile = $input->getArgument(YamlCommand::ARGUMENT_PATH_TO_CONFIG_FILE);
38
        $this->pathToConfigFile = $pathToConfigFile;
39
        $this->fixEnabled = $input->getOption(YamlCommand::OPTION_FIX);
40
        $this->pathToCacheDir = $input->getOption(YamlCommand::OPTION_PATH_TO_CACHE_DIR);
41
        $this->disableCache = $input->getOption(YamlCommand::OPTION_DISABLE_CACHE);
42
    }
43 7
44
    /**
45 7
     * @return string
46
     */
47
    public function getPathToConfigFile(): string
48
    {
49
        return $this->pathToConfigFile;
50
    }
51
52
    /**
53
     * @return bool
54
     */
55
    public function isFixEnabled(): bool
56
    {
57
        return $this->fixEnabled;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getPathToCacheDir(): string
64
    {
65
        return $this->pathToCacheDir;
66
    }
67
68
    /**
69
     * @return bool
70
     */
71
    public function isCacheDisabled(): bool
72
    {
73
        return $this->disableCache;
74
    }
75
}
76