Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 1765-1767 (lines=3) @@
1762
	 * @return bool
1763
	 */
1764
	public static function validate_module_list( $value = '', $request, $param ) {
1765
		if ( ! is_array( $value ) ) {
1766
			return new WP_Error( 'invalid_param_value', sprintf( esc_html__( '%s must be an array', 'jetpack' ), $param ) );
1767
		}
1768
1769
		$modules = Jetpack::get_available_modules();
1770
@@ 1848-1850 (lines=3) @@
1845
	 */
1846
	public static function validate_sharing_show( $value, $request, $param ) {
1847
		$views = array( 'index', 'post', 'page', 'attachment', 'jetpack-portfolio' );
1848
		if ( ! is_array( $value ) ) {
1849
			return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array of post types.', 'jetpack' ), $param ) );
1850
		}
1851
		if ( ! array_intersect( $views, $value ) ) {
1852
			return new WP_Error( 'invalid_param', sprintf(
1853
				/* 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 */