Conditions | 5 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
54 | private function fixHashMaps(&$data) |
||
55 | { |
||
56 | if (is_array($data)) { |
||
57 | $shouldBeObject = false; |
||
58 | $object = new \stdClass(); |
||
59 | $index = 0; |
||
60 | foreach ($data as $key => &$value) { |
||
61 | $object->$key = $this->fixHashMaps($value); |
||
62 | if ($index++ !== $key) { |
||
63 | $shouldBeObject = true; |
||
64 | } |
||
65 | } |
||
66 | if ($shouldBeObject) { |
||
67 | $data = $object; |
||
68 | } |
||
69 | } |
||
70 | |||
71 | return $data; |
||
72 | } |
||
73 | } |
||
74 |