Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 1808-1810 (lines=3) @@
1805
	 */
1806
	public static function validate_sharing_show( $value, $request, $param ) {
1807
		$views = array( 'index', 'post', 'page', 'attachment', 'jetpack-portfolio' );
1808
		if ( ! is_array( $value ) ) {
1809
			return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array of post types.', 'jetpack' ), $param ) );
1810
		}
1811
		if ( ! array_intersect( $views, $value ) ) {
1812
			return new WP_Error( 'invalid_param', sprintf(
1813
				/* 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 */
@@ 1725-1727 (lines=3) @@
1722
	 * @return bool
1723
	 */
1724
	public static function validate_module_list( $value = '', $request, $param ) {
1725
		if ( ! is_array( $value ) ) {
1726
			return new WP_Error( 'invalid_param_value', sprintf( esc_html__( '%s must be an array', 'jetpack' ), $param ) );
1727
		}
1728
1729
		$modules = Jetpack::get_available_modules();
1730