Conditions | 5 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
60 | 1 | private function serializeElements(array $item): array |
|
61 | { |
||
62 | 1 | if (isset($item['elements']) && is_array($item['elements'])) { |
|
63 | 1 | $finalElements = []; |
|
64 | 1 | foreach ($item['elements'] as $element) { |
|
65 | 1 | if (isset($element['id'])) { |
|
66 | 1 | $element = array_merge(['element' => $element['id']], $element); |
|
67 | 1 | unset($element['id']); |
|
68 | } |
||
69 | 1 | $finalElements[] = $element; |
|
70 | } |
||
71 | 1 | $item['elements'] = $finalElements; |
|
72 | } |
||
73 | 1 | return $item; |
|
74 | } |
||
75 | } |
||
76 |