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