| Conditions | 5 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | protected function validateConditions(array $conditions) |
||
| 28 | { |
||
| 29 | if (count($conditions) == 0) { |
||
| 30 | throw new \Exception('Content can not be matched because the matching conditions are empty'); |
||
| 31 | } |
||
| 32 | |||
| 33 | if (count($conditions) > $this->maxConditions) { |
||
| 34 | throw new \Exception($this->returns . ' can not be matched because multiple matching conditions are specified. Only a single condition is supported'); |
||
| 35 | } |
||
| 36 | |||
| 37 | foreach ($conditions as $key => $value) { |
||
| 38 | if (!in_array($key, $this->allowedConditions)) { |
||
| 39 | throw new \Exception($this->returns . " can not be matched because matching condition '$key' is not supported. Supported conditions are: " . |
||
| 40 | implode(', ', $this->allowedConditions)); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 |