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