Code Duplication    Length = 3-3 lines in 3 locations

includes/wc-rest-functions.php 1 location

@@ 166-168 (lines=3) @@
163
function wc_rest_validate_reports_request_arg( $value, $request, $param ) {
164
165
	$attributes = $request->get_attributes();
166
	if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {
167
		return true;
168
	}
169
	$args = $attributes['args'][ $param ];
170
171
	if ( 'string' === $args['type'] && ! is_string( $value ) ) {

includes/vendor/wp-rest-functions.php 2 locations

@@ 162-164 (lines=3) @@
159
	function rest_validate_request_arg( $value, $request, $param ) {
160
161
		$attributes = $request->get_attributes();
162
		if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {
163
			return true;
164
		}
165
		$args = $attributes['args'][ $param ];
166
167
		if ( ! empty( $args['enum'] ) ) {
@@ 247-249 (lines=3) @@
244
	function rest_sanitize_request_arg( $value, $request, $param ) {
245
246
		$attributes = $request->get_attributes();
247
		if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) {
248
			return $value;
249
		}
250
		$args = $attributes['args'][ $param ];
251
252
		if ( 'integer' === $args['type'] ) {