| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | 4 | public function check($definitions) |
|
| 45 | { |
||
| 46 | 4 | $raw_data = $this->getBody(); |
|
| 47 | 4 | $validator = $this->getValidator(); |
|
| 48 | |||
| 49 | 4 | $validator->check($raw_data, $definitions); |
|
| 50 | |||
| 51 | 4 | if (!$validator->isValid()) { |
|
| 52 | 1 | throw new UnprocessableException($validator->getErrors()); |
|
| 53 | } |
||
| 54 | |||
| 55 | 3 | $this->setData($validator->getData()); |
|
| 56 | } |
||
| 58 |