Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 0 |
1 | <?php |
||
40 | 9 | public function onPostDeserialize(ObjectEvent $event) |
|
41 | { |
||
42 | 9 | if ($event->getObject() instanceof PackageInterface) { |
|
43 | /** @var PackageInterface $package */ |
||
44 | 9 | $package = $event->getObject(); |
|
45 | |||
46 | 9 | if (null === $package->getItems()) { |
|
47 | $package->setItems(new ArrayCollection()); |
||
48 | } |
||
49 | } |
||
50 | 9 | } |
|
51 | } |
||
52 |