Code Duplication    Length = 12-12 lines in 2 locations

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

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