Code Duplication    Length = 42-42 lines in 2 locations

src/Surfnet/Stepup/Configuration/Value/ShowRaaContactInformationOption.php 1 location

@@ 24-65 (lines=42) @@
21
use JsonSerializable;
22
use Surfnet\Stepup\Exception\InvalidArgumentException;
23
24
final class ShowRaaContactInformationOption implements JsonSerializable
25
{
26
    /**
27
     * @var bool
28
     */
29
    private $showRaaContactInformationOption;
30
31
    public function __construct($showRaaContactInformationOption)
32
    {
33
        if (!is_bool($showRaaContactInformationOption)) {
34
            throw InvalidArgumentException::invalidType(
35
                'boolean',
36
                'showRaaContactInformationOption',
37
                $showRaaContactInformationOption
38
            );
39
        }
40
41
        $this->showRaaContactInformationOption = $showRaaContactInformationOption;
42
    }
43
44
    /**
45
     * @param ShowRaaContactInformationOption $other
46
     * @return bool
47
     */
48
    public function equals(ShowRaaContactInformationOption $other)
49
    {
50
        return $this->showRaaContactInformationOption === $other->showRaaContactInformationOption;
51
    }
52
53
    /**
54
     * @return boolean
55
     */
56
    public function isEnabled()
57
    {
58
        return $this->showRaaContactInformationOption;
59
    }
60
61
    public function jsonSerialize()
62
    {
63
        return $this->showRaaContactInformationOption;
64
    }
65
}
66

src/Surfnet/Stepup/Configuration/Value/UseRaLocationsOption.php 1 location

@@ 23-64 (lines=42) @@
20
21
use Surfnet\Stepup\Exception\InvalidArgumentException;
22
23
final class UseRaLocationsOption
24
{
25
    /**
26
     * @var bool
27
     */
28
    private $useRaLocationsOption;
29
30
    public function __construct($useRaLocationsOption)
31
    {
32
        if (!is_bool($useRaLocationsOption)) {
33
            throw InvalidArgumentException::invalidType(
34
                'boolean',
35
                'useRaLocationsOption',
36
                $useRaLocationsOption
37
            );
38
        }
39
40
        $this->useRaLocationsOption = $useRaLocationsOption;
41
    }
42
43
    /**
44
     * @param UseRaLocationsOption $other
45
     * @return bool
46
     */
47
    public function equals(UseRaLocationsOption $other)
48
    {
49
        return $this->useRaLocationsOption === $other->useRaLocationsOption;
50
    }
51
52
    /**
53
     * @return boolean
54
     */
55
    public function isEnabled()
56
    {
57
        return $this->useRaLocationsOption;
58
    }
59
60
    public function jsonSerialize()
61
    {
62
        return $this->useRaLocationsOption;
63
    }
64
}
65