Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
26 | public function onPostDeserialize(ObjectEvent $event) |
||
27 | { |
||
28 | $context = $event->getContext(); |
||
29 | |||
30 | if ($context->getDepth() > 0) { |
||
31 | return; |
||
32 | } |
||
33 | |||
34 | $groups = $context->attributes->get('groups')->getOrElse(null); |
||
35 | |||
36 | $list = $this->validator->validate($event->getObject(), $groups); |
||
37 | |||
38 | if ($list->count() > 0) { |
||
39 | throw EntityProcessingException::fromViolationList($list); |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 |