Code Duplication    Length = 9-9 lines in 2 locations

src/wp-includes/rest-api.php 2 locations

@@ 860-868 (lines=9) @@
857
 * @param  string           $param
858
 * @return WP_Error|boolean
859
 */
860
function rest_validate_request_arg( $value, $request, $param ) {
861
	$attributes = $request->get_attributes();
862
	if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {
863
		return true;
864
	}
865
	$args = $attributes['args'][ $param ];
866
867
	return rest_validate_value_from_schema( $value, $args, $param );
868
}
869
870
/**
871
 * Sanitize a request argument based on details registered to the route.
@@ 880-888 (lines=9) @@
877
 * @param  string           $param
878
 * @return mixed
879
 */
880
function rest_sanitize_request_arg( $value, $request, $param ) {
881
	$attributes = $request->get_attributes();
882
	if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {
883
		return $value;
884
	}
885
	$args = $attributes['args'][ $param ];
886
887
	return rest_sanitize_value_from_schema( $value, $args );
888
}
889
890
/**
891
 * Parse a request argument based on details registered to the route.