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