Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
15 | protected function validateValue($model) |
||
16 | { |
||
17 | if (!$model instanceof Model) { |
||
18 | throw new InvalidParamException('Passed value must be instance of Model'); |
||
19 | } |
||
20 | |||
21 | if (!$model->validate()) { |
||
22 | return [reset($model->getFirstErrors()), []]; // todo: return more than one error |
||
|
|||
23 | } |
||
24 | |||
25 | return null; |
||
26 | } |
||
27 | } |
||
28 |