Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 2634-2636 (lines=3) @@
2631
	 * @return bool|WP_Error
2632
	 */
2633
	public static function validate_module_list( $value = '', $request, $param ) {
2634
		if ( ! is_array( $value ) ) {
2635
			return new WP_Error( 'invalid_param_value', sprintf( esc_html__( '%s must be an array', 'jetpack' ), $param ) );
2636
		}
2637
2638
		$modules = Jetpack::get_available_modules();
2639
@@ 2717-2719 (lines=3) @@
2714
	 */
2715
	public static function validate_sharing_show( $value, $request, $param ) {
2716
		$views = array( 'index', 'post', 'page', 'attachment', 'jetpack-portfolio' );
2717
		if ( ! is_array( $value ) ) {
2718
			return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array of post types.', 'jetpack' ), $param ) );
2719
		}
2720
		if ( ! array_intersect( $views, $value ) ) {
2721
			return new WP_Error( 'invalid_param', sprintf(
2722
				/* 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 */