Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 819-829 (lines=11) @@
816
	 * @param array     $query_params sub-array from @see EEM_Base::get_all()
817
	 * @return array
818
	 */
819
	public function prepare_rest_query_params_key_for_models( $model,  $query_params ) {
820
		$model_ready_query_params = array();
821
		foreach( $query_params as $key => $value ) {
822
			if( is_array( $value ) ) {
823
				$model_ready_query_params[ $key ] = $this->prepare_rest_query_params_key_for_models( $model, $value );
824
			}else{
825
				$model_ready_query_params[ $key ] = $value;
826
			}
827
		}
828
		return $model_ready_query_params;
829
	}
830
831
832
@@ 839-849 (lines=11) @@
836
	 * @param $query_params
837
	 * @return array
838
	 */
839
	public function prepare_rest_query_params_values_for_models( $model, $query_params ) {
840
		$model_ready_query_params = array();
841
		foreach( $query_params as $key => $value ) {
842
			if( is_array( $value ) ) {
843
				$model_ready_query_params[ $key ] = $this->prepare_rest_query_params_values_for_models( $model, $value );
844
			} else {
845
				$model_ready_query_params[ $key ] = $value;
846
			}
847
		}
848
		return $model_ready_query_params;
849
	}
850
851
	/**
852
	 * Explodes the string on commas, and only returns items with $prefix followed by a period.