Code Duplication    Length = 5-5 lines in 2 locations

src/Sensorario/Resources/Container.php 2 locations

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