Completed
Push — master ( deb1d5...3324ab )
by Pablo
04:13
created

Module/Configuration/Domain/JsonLint.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Domain;
4
5
use PhpGitHooks\Module\Configuration\Model\ToolInterface;
6
7 View Code Duplication
class JsonLint implements ToolInterface
0 ignored issues
show
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
    /**
19
     * JsonLint constructor.
20
     *
21
     * @param Undefined $undefined
22
     * @param Enabled   $enabled
23
     */
24 6
    public function __construct(Undefined $undefined, Enabled $enabled)
25
    {
26 6
        $this->undefined = $undefined;
27 6
        $this->enabled = $enabled;
28 6
    }
29
30
    /**
31
     * @return bool
32
     */
33 4
    public function isEnabled()
34
    {
35 4
        return $this->enabled->value();
36
    }
37
38
    /**
39
     * @return bool
40
     */
41 3
    public function isUndefined()
42
    {
43 3
        return $this->undefined->value();
44
    }
45
46
    /**
47
     * @param Enabled $enabled
48
     *
49
     * @return JsonLint
50
     */
51 2
    public function setEnabled(Enabled $enabled)
52
    {
53 2
        return new self(
54 2
            new Undefined(false),
55
            $enabled
56 2
        );
57
    }
58
}
59