Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 2024-2026 (lines=3) @@
2021
			return true;
2022
		}
2023
2024
		if ( ! class_exists( 'Sharing_Service' ) && ! include_once( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
2025
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
2026
		}
2027
		$sharer = new Sharing_Service();
2028
		$services = array_keys( $sharer->get_all_services() );
2029
@@ 2064-2066 (lines=3) @@
2061
			return true;
2062
		}
2063
2064
		if ( ! class_exists( 'Sharing_Service' ) && ! include_once( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
2065
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
2066
		}
2067
2068
		if ( ( ! empty( $value['sharing_name'] ) && ! is_string( $value['sharing_name'] ) )
2069
		|| ( ! empty( $value['sharing_url'] ) && ! is_string( $value['sharing_url'] ) )
@@ 2092-2094 (lines=3) @@
2089
			return new WP_Error( 'invalid_param', sprintf( esc_html__( "%s must be a string prefixed with 'custom-' and followed by a numeric ID.", 'jetpack' ), $param ) );
2090
		}
2091
2092
		if ( ! class_exists( 'Sharing_Service' ) && ! include_once( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
2093
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
2094
		}
2095
		$sharer = new Sharing_Service();
2096
		$services = array_keys( $sharer->get_all_services() );
2097