Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 896-903 (lines=8) @@
893
	public static function get_rewind_data() {
894
		$rewind_data = self::rewind_data();
895
896
		if ( ! is_wp_error( $rewind_data ) ) {
897
			return rest_ensure_response( array(
898
					'code' => 'success',
899
					'message' => esc_html__( 'Rewind data correctly received.', 'jetpack' ),
900
					'data' => wp_json_encode( $rewind_data ),
901
				)
902
			);
903
		}
904
905
		if ( $rewind_data->get_error_code() === 'rewind_data_fetch_failed' ) {
906
			return new WP_Error( 'rewind_data_fetch_failed', esc_html__( 'Failed fetching rewind data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
@@ 1195-1202 (lines=8) @@
1192
	public static function get_site_data() {
1193
		$site_data = self::site_data();
1194
1195
		if ( ! is_wp_error( $site_data ) ) {
1196
			return rest_ensure_response( array(
1197
					'code' => 'success',
1198
					'message' => esc_html__( 'Site data correctly received.', 'jetpack' ),
1199
					'data' => json_encode( $site_data ),
1200
				)
1201
			);
1202
		}
1203
		if ( $site_data->get_error_code() === 'site_data_fetch_failed' ) {
1204
			return new WP_Error( 'site_data_fetch_failed', esc_html__( 'Failed fetching site data. Try again later.', 'jetpack' ), array( 'status' => 400 ) );
1205
		}