Code Duplication    Length = 3-3 lines in 2 locations

projects/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php 2 locations

@@ 59-61 (lines=3) @@
56
			return new WP_Error( 'invalid_queue', 'Queue name is required', 400 );
57
		}
58
59
		if ( ! in_array( $query, array( 'sync', 'full_sync', 'immediate' ) ) ) {
60
			return new WP_Error( 'invalid_queue', 'Queue name should be sync, full_sync or immediate', 400 );
61
		}
62
		return $query;
63
	}
64
}
@@ 439-441 (lines=3) @@
436
			return new WP_Error( 'invalid_queue', 'Queue name is required', 400 );
437
		}
438
439
		if ( ! in_array( $args['queue'], array( 'sync', 'full_sync' ) ) ) {
440
			return new WP_Error( 'invalid_queue', 'Queue name should be sync or full_sync', 400 );
441
		}
442
443
		$queue = new Queue( $args['queue'] );
444