PHPUnitOption::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Paraunit\Configuration;
6
7
/**
8
 * Class PHPUnitOption
9
 * @package Paraunit\Configuration
10
 */
11
class PHPUnitOption
12
{
13
    /** @var string */
14
    private $name;
15
16
    /** @var string|null */
17
    private $shortName;
18
19
    /** @var string|null */
20
    private $value;
21
22
    /** @var bool */
23
    private $hasValue;
24
25
    /**
26
     * PHPUnitOption constructor.
27
     * @param string $name
28
     * @param bool $hasValue
29
     * @param string | null $shortName
30
     */
31 28
    public function __construct(string $name, bool $hasValue = true, string $shortName = null)
32
    {
33 28
        $this->name = $name;
34 28
        $this->hasValue = $hasValue;
35 28
        $this->shortName = $shortName;
36
    }
37
38 28
    public function getName(): string
39
    {
40 28
        return $this->name;
41
    }
42
43
    /**
44
     * @return string|null
45
     */
46 24
    public function getShortName()
47
    {
48 24
        return $this->shortName;
49
    }
50
51
    /**
52
     * @param string $value
53
     */
54 7
    public function setValue(string $value = null)
55
    {
56 7
        $this->value = $value;
57
    }
58
59
    /**
60
     * @return string|null
61
     */
62 6
    public function getValue()
63
    {
64 6
        return $this->value;
65
    }
66
67 28
    public function hasValue(): bool
68
    {
69 28
        return $this->hasValue;
70
    }
71
}
72