Option::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace kalanis\kw_clipr\Tasks\Params;
4
5
6
/**
7
 * Class Option
8
 * @package kalanis\kw_clipr\Tasks\Params
9
 */
10
class Option
11
{
12
    protected string $variable = '';
13
    protected string $cliKey = '';
14
    protected ?string $match = null;
15
    /** @var mixed */
16
    protected $defaultValue = null;
17
    /** @var mixed */
18
    protected $value = null;
19
    protected ?string $short = null;
20
    protected string $description = '';
21
22
    /**
23
     * @param string $variable
24
     * @param string $cliKey
25
     * @param string|null $match
26
     * @param mixed $defaultValue
27
     * @param string|null $short
28
     * @param string $description
29
     * @return $this
30
     */
31 21
    public function setData(string $variable, string $cliKey, ?string $match, $defaultValue = null, ?string $short = null, string $description = ''): self
32
    {
33 21
        $this->variable = $variable;
34 21
        $this->cliKey = $cliKey;
35 21
        $this->match = $match;
36 21
        $this->short = $short;
37 21
        $this->description = $description;
38 21
        $this->defaultValue = $defaultValue;
39 21
        return $this;
40
    }
41
42
    /**
43
     * @param mixed $value
44
     * @return $this
45
     */
46 21
    public function setValue($value): self
47
    {
48 21
        $this->value = $value;
49 21
        return $this;
50
    }
51
52
    /**
53
     * @return mixed
54
     */
55 21
    public function getValue()
56
    {
57 21
        return $this->value;
58
    }
59
60
    /**
61
     * @return mixed
62
     */
63 21
    public function getDefaultValue()
64
    {
65 21
        return $this->defaultValue;
66
    }
67
68 4
    public function getVariable(): string
69
    {
70 4
        return $this->variable;
71
    }
72
73 21
    public function getCliKey(): string
74
    {
75 21
        return $this->cliKey;
76
    }
77
78 9
    public function getMatch(): ?string
79
    {
80 9
        return $this->match;
81
    }
82
83 21
    public function getShort(): ?string
84
    {
85 21
        return $this->short;
86
    }
87
88 2
    public function getDescription(): string
89
    {
90 2
        return $this->description;
91
    }
92
}
93