Code Duplication    Length = 5-5 lines in 2 locations

src/Sensorario/Resources/Container.php 2 locations

@@ 66-70 (lines=5) @@
63
    public function create($resource, array $constraints)
64
    {
65
        foreach ($constraints as $name => $value) {
66
            if (!isset($this->resources['resources'][$resource]['constraints']['allowed'])) {
67
                throw new RuntimeException(
68
                    'Not allowed `' . $name . '` constraint with value `' . $value . '`'
69
                );
70
            }
71
72
            if (!in_array($name, $this->resources['resources'][$resource]['constraints']['allowed'])) {
73
                throw new RuntimeException(
@@ 72-76 (lines=5) @@
69
                );
70
            }
71
72
            if (!in_array($name, $this->resources['resources'][$resource]['constraints']['allowed'])) {
73
                throw new RuntimeException(
74
                    'Not allowed `' . $name . '` constraint with value `' . $value . '`'
75
                );
76
            }
77
        }
78
    }
79