Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 2012-2014 (lines=3) @@
2009
	 * @return bool
2010
	 */
2011
	public static function validate_services( $value, $request, $param ) {
2012
		if ( ! is_array( $value ) || ! isset( $value['visible'] ) || ! isset( $value['hidden'] ) ) {
2013
			return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array with visible and hidden items.', 'jetpack' ), $param ) );
2014
		}
2015
2016
		// Allow to clear everything.
2017
		if ( empty( $value['visible'] ) && empty( $value['hidden'] ) ) {
@@ 2049-2051 (lines=3) @@
2046
	 * @return bool
2047
	 */
2048
	public static function validate_custom_service( $value, $request, $param ) {
2049
		if ( ! is_array( $value ) || ! isset( $value['sharing_name'] ) || ! isset( $value['sharing_url'] ) || ! isset( $value['sharing_icon'] ) ) {
2050
			return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be an array with sharing name, url and icon.', 'jetpack' ), $param ) );
2051
		}
2052
2053
		// Allow to clear everything.
2054
		if ( empty( $value['sharing_name'] ) && empty( $value['sharing_url'] ) && empty( $value['sharing_icon'] ) ) {