Completed
Push — master ( 879230...0afc29 )
by Pablo
05:15
created

PhpUnitStrictCoverage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 6
loc 6
rs 9.4285
c 0
b 0
f 0
ccs 5
cts 5
cp 1
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Domain;
4
5
use PhpGitHooks\Module\Configuration\Model\ToolInterface;
6
7 View Code Duplication
class PhpUnitStrictCoverage implements ToolInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /**
10
     * @var Undefined
11
     */
12
    private $undefined;
13
    /**
14
     * @var Enabled
15
     */
16
    private $enabled;
17
    /**
18
     * @var MinimumStrictCoverage
19
     */
20
    private $minimumStrictCoverage;
21
22
    /**
23
     * PhpUnitStrictCoverage constructor.
24
     *
25
     * @param Undefined             $undefined
26
     * @param Enabled               $enabled
27
     * @param MinimumStrictCoverage $minimumStrictCoverage
28
     */
29 6
    public function __construct(Undefined $undefined, Enabled $enabled, MinimumStrictCoverage $minimumStrictCoverage)
30
    {
31 6
        $this->undefined = $undefined;
32 6
        $this->enabled = $enabled;
33 6
        $this->minimumStrictCoverage = $minimumStrictCoverage;
34 6
    }
35
36
    /**
37
     * @return bool
38
     */
39 3
    public function isEnabled()
40
    {
41 3
        return $this->enabled->value();
42
    }
43
44
    /**
45
     * @return bool
46
     */
47 3
    public function isUndefined()
48
    {
49 3
        return $this->undefined->value();
50
    }
51
52
    /**
53
     * @return MinimumStrictCoverage
54
     */
55 3
    public function getMinimumStrictCoverage()
56
    {
57 3
        return $this->minimumStrictCoverage;
58
    }
59
60
    /**
61
     * @param MinimumStrictCoverage $strictCoverage
62
     *
63
     * @return PhpUnitStrictCoverage
64
     */
65 1
    public function setStrictCoverage(MinimumStrictCoverage $strictCoverage)
66
    {
67 1
        return new self(
68 1
            $this->undefined,
69 1
            $this->enabled,
70 1
            $strictCoverage
71
        );
72
    }
73
74
    /**
75
     * @param Enabled $enabled
76
     *
77
     * @return PhpUnitStrictCoverage
78
     */
79 2
    public function setEnabled(Enabled $enabled)
80
    {
81 2
        return new self(
82 2
            new Undefined(false),
83 2
            $enabled,
84 2
            $this->minimumStrictCoverage
85
        );
86
    }
87
}
88