Code Duplication    Length = 5-5 lines in 2 locations

code/blocks/google-maps/fields/GoogleMapField.php 1 location

@@ 149-153 (lines=5) @@
146
     * @return array
147
     */
148
    private static function array_keys_to_objects(array $data = []) {
149
        foreach ($data as $key => $value) {
150
            if (is_array($value)) {
151
                $data[$key] = json_decode(json_encode((object) $value), false);
152
            }
153
        }
154
155
        return $data;
156
    }

code/blocks/google-maps/models/MapBlock.php 1 location

@@ 206-210 (lines=5) @@
203
            $data['map']['styles'] = (string) $styles;
204
        }
205
206
        foreach ($data as $key => $value) {
207
            if (is_array($value)) {
208
                $data[$key] = json_decode(json_encode((object) $value), false);
209
            }
210
        }
211
212
        if (count($data)) {
213
            return \Convert::raw2att(\Convert::array2json($data));