Conditions | 5 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
37 | 1 | private function serializeElements(array $item): array |
|
38 | { |
||
39 | 1 | if (isset($item['elements']) && is_array($item['elements'])) { |
|
40 | 1 | $finalElements = []; |
|
41 | 1 | foreach ($item['elements'] as $element) { |
|
42 | 1 | if (isset($element['id'])) { |
|
43 | 1 | $element = array_merge(['element' => $element['id']], $element); |
|
44 | 1 | unset($element['id']); |
|
45 | } |
||
46 | 1 | $finalElements[] = $element; |
|
47 | } |
||
48 | 1 | $item['elements'] = $finalElements; |
|
49 | } |
||
50 | 1 | return $item; |
|
51 | } |
||
52 | } |
||
53 |