Code Duplication    Length = 8-12 lines in 2 locations

src/Suricate/Service.php 2 locations

@@ 16-27 (lines=12) @@
13
14
    }
15
16
    public function __get($variable)
17
    {
18
        if (in_array($variable, $this->parametersList)) {
19
            if (isset($this->parametersValues[$variable])) {
20
                return $this->parametersValues[$variable];
21
            } else {
22
                return null;
23
            }
24
        } else {
25
            throw new InvalidArgumentException("Unknown configuration property " . get_called_class() . '->' .$variable);
26
        }
27
    }
28
29
    public function __set($variable, $value)
30
    {
@@ 53-60 (lines=8) @@
50
        $this->init();
51
    }
52
53
    public function getParameter($parameter)
54
    {
55
        if (in_array($parameter, $this->parametersList)) {
56
            return isset($this->parametersValues[$parameter]) ? $this->parametersValues[$parameter] : null;
57
        } else {
58
            throw new InvalidArgumentException("Unknown configuration property : " . get_called_class() . "->" . $parameter);
59
        }
60
    }
61
62
    protected function init()
63
    {