Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 1951-1953 (lines=3) @@
1948
	 * @return bool
1949
	 */
1950
	public static function validate_services( $value, $request, $param ) {
1951
		if ( ! is_array( $value ) || ! isset( $value['visible'] ) || ! isset( $value['hidden'] ) ) {
1952
			return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array with visible and hidden items.', 'jetpack' ), $param ) );
1953
		}
1954
1955
		// Allow to clear everything.
1956
		if ( empty( $value['visible'] ) && empty( $value['hidden'] ) ) {
@@ 1988-1990 (lines=3) @@
1985
	 * @return bool
1986
	 */
1987
	public static function validate_custom_service( $value, $request, $param ) {
1988
		if ( ! is_array( $value ) || ! isset( $value['sharing_name'] ) || ! isset( $value['sharing_url'] ) || ! isset( $value['sharing_icon'] ) ) {
1989
			return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array with sharing name, url and icon.', 'jetpack' ), $param ) );
1990
		}
1991
1992
		// Allow to clear everything.
1993
		if ( empty( $value['sharing_name'] ) && empty( $value['sharing_url'] ) && empty( $value['sharing_icon'] ) ) {