| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 46 | public function check($definitions) |
||
| 47 | { |
||
| 48 | $raw_data = $this->getBody(); |
||
| 49 | $schema = json_decode($definitions); |
||
| 50 | $validator = $this->getValidator(); |
||
| 51 | |||
| 52 | $validator->check($raw_data, $schema); |
||
| 53 | |||
| 54 | if (!$validator->isValid()) { |
||
| 55 | throw new UnprocessableException($validator->getErrors()); |
||
| 56 | } |
||
| 57 | |||
| 58 | $this->setData((array) $raw_data); |
||
| 59 | } |
||
| 60 | } |
||
| 61 |