Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
33 | 2 | public function denormalize($data, $class, $format = null, array $context = []): CollectionInterface |
|
34 | { |
||
35 | /** @var CollectionInterface $collection */ |
||
36 | 2 | $collection = new $class(); |
|
37 | |||
38 | 2 | $itemType = $collection->getType(); |
|
39 | |||
40 | 2 | foreach ($data as $item) { |
|
41 | 2 | $item = $this->denormalizer->denormalize($item, $itemType, $format, $context); |
|
42 | 2 | $collection->add($item); |
|
43 | } |
||
44 | |||
45 | 2 | return $collection; |
|
46 | } |
||
48 |