Code Duplication    Length = 12-12 lines in 2 locations

class.FlipREST.php 2 locations

@@ 189-200 (lines=12) @@
186
        if(array_keys($entity) === range(0, count($entity) - 1))
187
        {
188
            $tmpCount = count($entity);
189
            for($i = 0; $i < $tmpCount; $i++)
190
            {
191
                $tmpKey = $keyPrefix.'['.$i.']';
192
                if(is_object($entity[$i]) || is_array($entity[$i]))
193
                {
194
                    $this->collapseEntityToArray($entity[$i], $array, $tmpKey);
195
                }
196
                else
197
                {
198
                    $array[$tmpKey] = $entity[$i];
199
                }
200
            }
201
            return;
202
        }
203
@@ 233-244 (lines=12) @@
230
                {
231
                    //Numeric array
232
                    $tmpCount = count($data);
233
                    for($j = 0; $j < $tmpCount; $j++)
234
                    {
235
                        $tmpKey = $keyPrefix.$key.'['.$j.']';
236
                        if(is_object($data[$j]) || is_array($data[$j]))
237
                        {
238
                            $this->collapseEntityToArray($data[$j], $array, $tmpKey);
239
                        }
240
                        else
241
                        {
242
                            $array[$tmpKey] = $data[$j];
243
                        }
244
                    }
245
                }
246
            }
247
            else