Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 1847-1849 (lines=3) @@
1844
			return true;
1845
		}
1846
1847
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
1848
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
1849
		}
1850
		$sharer = new Sharing_Service();
1851
		$services = array_keys( $sharer->get_all_services() );
1852
@@ 1887-1889 (lines=3) @@
1884
			return true;
1885
		}
1886
1887
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
1888
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
1889
		}
1890
1891
		if ( ( ! empty( $value['sharing_name'] ) && ! is_string( $value['sharing_name'] ) )
1892
		|| ( ! empty( $value['sharing_url'] ) && ! is_string( $value['sharing_url'] ) )
@@ 1915-1917 (lines=3) @@
1912
			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 ) );
1913
		}
1914
1915
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
1916
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
1917
		}
1918
		$sharer = new Sharing_Service();
1919
		$services = array_keys( $sharer->get_all_services() );
1920