@@ 7-58 (lines=52) @@ | ||
4 | ||
5 | use PhpGitHooks\Module\Configuration\Model\ToolInterface; |
|
6 | ||
7 | class Composer implements ToolInterface |
|
8 | { |
|
9 | /** |
|
10 | * @var Enabled |
|
11 | */ |
|
12 | private $enabled; |
|
13 | /** |
|
14 | * @var Undefined |
|
15 | */ |
|
16 | private $undefined; |
|
17 | ||
18 | /** |
|
19 | * Composer constructor. |
|
20 | * |
|
21 | * @param Undefined $undefined |
|
22 | * @param Enabled $enabled |
|
23 | */ |
|
24 | public function __construct(Undefined $undefined, Enabled $enabled) |
|
25 | { |
|
26 | $this->enabled = $enabled; |
|
27 | $this->undefined = $undefined; |
|
28 | } |
|
29 | ||
30 | /** |
|
31 | * @return bool |
|
32 | */ |
|
33 | public function isEnabled() |
|
34 | { |
|
35 | return $this->enabled->value(); |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @return bool |
|
40 | */ |
|
41 | public function isUndefined() |
|
42 | { |
|
43 | return $this->undefined->value(); |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @param Enabled $enabled |
|
48 | * |
|
49 | * @return Composer |
|
50 | */ |
|
51 | public function setEnabled(Enabled $enabled) |
|
52 | { |
|
53 | return new self( |
|
54 | new Undefined(false), |
|
55 | $enabled |
|
56 | ); |
|
57 | } |
|
58 | } |
|
59 |
@@ 7-58 (lines=52) @@ | ||
4 | ||
5 | use PhpGitHooks\Module\Configuration\Model\ToolInterface; |
|
6 | ||
7 | class JsonLint implements ToolInterface |
|
8 | { |
|
9 | /** |
|
10 | * @var Undefined |
|
11 | */ |
|
12 | private $undefined; |
|
13 | /** |
|
14 | * @var Enabled |
|
15 | */ |
|
16 | private $enabled; |
|
17 | ||
18 | /** |
|
19 | * JsonLint constructor. |
|
20 | * |
|
21 | * @param Undefined $undefined |
|
22 | * @param Enabled $enabled |
|
23 | */ |
|
24 | public function __construct(Undefined $undefined, Enabled $enabled) |
|
25 | { |
|
26 | $this->undefined = $undefined; |
|
27 | $this->enabled = $enabled; |
|
28 | } |
|
29 | ||
30 | /** |
|
31 | * @return bool |
|
32 | */ |
|
33 | public function isEnabled() |
|
34 | { |
|
35 | return $this->enabled->value(); |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @return bool |
|
40 | */ |
|
41 | public function isUndefined() |
|
42 | { |
|
43 | return $this->undefined->value(); |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @param Enabled $enabled |
|
48 | * |
|
49 | * @return JsonLint |
|
50 | */ |
|
51 | public function setEnabled(Enabled $enabled) |
|
52 | { |
|
53 | return new self( |
|
54 | new Undefined(false), |
|
55 | $enabled |
|
56 | ); |
|
57 | } |
|
58 | } |
|
59 |
@@ 7-58 (lines=52) @@ | ||
4 | ||
5 | use PhpGitHooks\Module\Configuration\Model\ToolInterface; |
|
6 | ||
7 | class PhpLint implements ToolInterface |
|
8 | { |
|
9 | /** |
|
10 | * @var Undefined |
|
11 | */ |
|
12 | private $undefined; |
|
13 | /** |
|
14 | * @var Enabled |
|
15 | */ |
|
16 | private $enabled; |
|
17 | ||
18 | /** |
|
19 | * PhpLint constructor. |
|
20 | * |
|
21 | * @param Undefined $undefined |
|
22 | * @param Enabled $enabled |
|
23 | */ |
|
24 | public function __construct(Undefined $undefined, Enabled $enabled) |
|
25 | { |
|
26 | $this->undefined = $undefined; |
|
27 | $this->enabled = $enabled; |
|
28 | } |
|
29 | ||
30 | /** |
|
31 | * @return bool |
|
32 | */ |
|
33 | public function isEnabled() |
|
34 | { |
|
35 | return $this->enabled->value(); |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @return bool |
|
40 | */ |
|
41 | public function isUndefined() |
|
42 | { |
|
43 | return $this->undefined->value(); |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @param Enabled $enabled |
|
48 | * |
|
49 | * @return PhpLint |
|
50 | */ |
|
51 | public function setEnabled(Enabled $enabled) |
|
52 | { |
|
53 | return new self( |
|
54 | new Undefined(false), |
|
55 | $enabled |
|
56 | ); |
|
57 | } |
|
58 | } |
|
59 |