Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 1859-1861 (lines=3) @@
1856
			return true;
1857
		}
1858
1859
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
1860
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
1861
		}
1862
		$sharer = new Sharing_Service();
1863
		$services = array_keys( $sharer->get_all_services() );
1864
@@ 1899-1901 (lines=3) @@
1896
			return true;
1897
		}
1898
1899
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
1900
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
1901
		}
1902
1903
		if ( ( ! empty( $value['sharing_name'] ) && ! is_string( $value['sharing_name'] ) )
1904
		|| ( ! empty( $value['sharing_url'] ) && ! is_string( $value['sharing_url'] ) )
@@ 1927-1929 (lines=3) @@
1924
			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 ) );
1925
		}
1926
1927
		if ( ! class_exists( 'Sharing_Service' ) && ! @include( JETPACK__PLUGIN_DIR . 'modules/sharedaddy/sharing-service.php' ) ) {
1928
			return new WP_Error( 'invalid_param', esc_html__( 'Failed loading required dependency Sharing_Service.', 'jetpack' ) );
1929
		}
1930
		$sharer = new Sharing_Service();
1931
		$services = array_keys( $sharer->get_all_services() );
1932