Code Duplication    Length = 12-12 lines in 2 locations

core/libraries/rest_api/controllers/model/Read.php 2 locations

@@ 1362-1373 (lines=12) @@
1359
     * @param array    $query_params sub-array from @see EEM_Base::get_all()
1360
     * @return array
1361
     */
1362
    public function prepareRestQueryParamsKeyForModels($model, $query_params)
1363
    {
1364
        $model_ready_query_params = array();
1365
        foreach ($query_params as $key => $value) {
1366
            if (is_array($value)) {
1367
                $model_ready_query_params[ $key ] = $this->prepareRestQueryParamsKeyForModels($model, $value);
1368
            } else {
1369
                $model_ready_query_params[ $key ] = $value;
1370
            }
1371
        }
1372
        return $model_ready_query_params;
1373
    }
1374
1375
1376
    /**
@@ 1382-1393 (lines=12) @@
1379
     * @param $query_params
1380
     * @return array
1381
     */
1382
    public function prepareRestQueryParamsValuesForModels($model, $query_params)
1383
    {
1384
        $model_ready_query_params = array();
1385
        foreach ($query_params as $key => $value) {
1386
            if (is_array($value)) {
1387
                $model_ready_query_params[ $key ] = $this->prepareRestQueryParamsValuesForModels($model, $value);
1388
            } else {
1389
                $model_ready_query_params[ $key ] = $value;
1390
            }
1391
        }
1392
        return $model_ready_query_params;
1393
    }
1394
1395
1396
    /**