Code Duplication    Length = 5-5 lines in 2 locations

src/Sensorario/Resources/Container.php 2 locations

@@ 48-52 (lines=5) @@
45
    public function create($resource, array $constraints)
46
    {
47
        foreach ($constraints as $name => $value) {
48
            if (!isset($this->resources['resources'][$resource]['constraints']['allowed'])) {
49
                throw new RuntimeException(
50
                    'Not allowed `' . $name . '` constraint'
51
                );
52
            }
53
54
            if (!in_array($name, $this->resources['resources'][$resource]['constraints']['allowed'])) {
55
                throw new RuntimeException(
@@ 54-58 (lines=5) @@
51
                );
52
            }
53
54
            if (!in_array($name, $this->resources['resources'][$resource]['constraints']['allowed'])) {
55
                throw new RuntimeException(
56
                    'Not allowed `' . $name . '` constraint'
57
                );
58
            }
59
        }
60
    }
61