Code Duplication    Length = 3-3 lines in 2 locations

json-endpoints/class.wpcom-json-api-site-user-endpoint.php 1 location

@@ 209-211 (lines=3) @@
206
			}
207
208
			$editable_roles = array_keys( get_editable_roles() );
209
			if ( ! in_array( $user['role'], $editable_roles ) ) {
210
				return new WP_Error( 'invalid_input', sprintf( __( '%s is not a valid role.', 'jetpack' ), $editable_roles ), 400 );
211
			}
212
		}
213
214
		$result = wp_update_user( $user );

class.jetpack-data.php 1 location

@@ 180-182 (lines=3) @@
177
			'src.wordpress-develop.test',   // VVV
178
			'build.wordpress-develop.test', // VVV
179
		);
180
		if ( in_array( $domain, $forbidden_domains ) ) {
181
			return new WP_Error( 'fail_domain_forbidden', sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it is in the forbidden array.', 'jetpack' ), $domain ) );
182
		}
183
184
		// No .test or .local domains
185
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {