Code Duplication    Length = 10-10 lines in 2 locations

src/Sensorario/Resources/Rule.php 1 location

@@ 37-46 (lines=10) @@
34
        return new self($rule);
35
    }
36
37
    public function ensureRuleNameIsValid()
38
    {
39
        if (!$this->isValid()) {
40
            throw new \RuntimeException(
41
                'Oops! Invalid configuration!!!'
42
                . 'Type `' . key($this->rule) . '` is not valid. '
43
                . 'Available types are ' . var_export(static::$avalableRuleTypes, true)
44
            );
45
        }
46
    }
47
48
    public function asArray() : array
49
    {

src/Sensorario/Resources/Rulers/Rule.php 1 location

@@ 46-55 (lines=10) @@
43
        return new self($rule);
44
    }
45
46
    public function ensureRuleNameIsValid()
47
    {
48
        if (!$this->isValid()) {
49
            throw new \RuntimeException(
50
                'Oops! Invalid configuration!!!'
51
                . 'Type `' . key($this->rule) . '` is not valid. '
52
                . 'Available types are ' . var_export(static::$avalableRuleTypes, true)
53
            );
54
        }
55
    }
56
57
    public function asArray() : array
58
    {