Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
27 | public function validate(ValidateParamsEvent $event) |
||
28 | { |
||
29 | $method = $event->getMethod(); |
||
30 | if (!$method instanceof MethodWithValidatedParams) { |
||
31 | return; |
||
32 | } |
||
33 | foreach ($this->validator->validate($event->getParamList(), $method->getParamsConstraint()) as $violation) { |
||
34 | $event->addViolation([ |
||
35 | 'path' => $violation->getPropertyPath(), |
||
36 | 'message' => $violation->getMessage(), |
||
37 | 'code' => $violation->getCode(), |
||
38 | ]); |
||
42 |