Code Duplication    Length = 3-3 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 2 locations

@@ 2357-2359 (lines=3) @@
2354
	 * @return bool|WP_Error
2355
	 */
2356
	public static function validate_module_list( $value = '', $request, $param ) {
2357
		if ( ! is_array( $value ) ) {
2358
			return new WP_Error( 'invalid_param_value', sprintf( esc_html__( '%s must be an array', 'jetpack' ), $param ) );
2359
		}
2360
2361
		$modules = Jetpack::get_available_modules();
2362
@@ 2440-2442 (lines=3) @@
2437
	 */
2438
	public static function validate_sharing_show( $value, $request, $param ) {
2439
		$views = array( 'index', 'post', 'page', 'attachment', 'jetpack-portfolio' );
2440
		if ( ! is_array( $value ) ) {
2441
			return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array of post types.', 'jetpack' ), $param ) );
2442
		}
2443
		if ( ! array_intersect( $views, $value ) ) {
2444
			return new WP_Error( 'invalid_param', sprintf(
2445
				/* Translators: first variable is the name of a parameter passed to endpoint holding the post type where Sharing will be displayed, the second is a list of post types where Sharing can be displayed */