Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 2146-2148 (lines=3) @@
2143
			return true;
2144
		}
2145
2146
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
2147
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
2148
		}
2149
		$sharer = new Sharing_Service();
2150
		$services = array_keys( $sharer->get_all_services() );
2151
@@ 2183-2185 (lines=3) @@
2180
			return true;
2181
		}
2182
2183
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
2184
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
2185
		}
2186
2187
		if ( ( ! empty( $value['sharing_name'] ) && ! is_string( $value['sharing_name'] ) )
2188
		|| ( ! empty( $value['sharing_url'] ) && ! is_string( $value['sharing_url'] ) )
@@ 2211-2213 (lines=3) @@
2208
			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 ) );
2209
		}
2210
2211
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
2212
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
2213
		}
2214
		$sharer = new Sharing_Service();
2215
		$services = array_keys( $sharer->get_all_services() );
2216