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