Code Duplication    Length = 6-6 lines in 2 locations

_inc/lib/core-api/wpcom-endpoints/memberships.php 2 locations

@@ 121-126 (lines=6) @@
118
					'interval' => $request['interval'],
119
				)
120
			);
121
			if ( is_wp_error( $response ) ) {
122
				if ( $response->get_error_code() === 'missing_token' ) {
123
					return new WP_Error( 'missing_token', __( 'Please connect your user account to WordPress.com', 'jetpack' ), 404 );
124
				}
125
				return new WP_Error( 'wpcom_connection_error', __( 'Could not connect to WordPress.com', 'jetpack' ), 404 );
126
			}
127
			$data = isset( $response['body'] ) ? json_decode( $response['body'], true ) : null;
128
			return $data;
129
		}
@@ 157-162 (lines=6) @@
154
				array(),
155
				null
156
			);
157
			if ( is_wp_error( $response ) ) {
158
				if ( $response->get_error_code() === 'missing_token' ) {
159
					return new WP_Error( 'missing_token', __( 'Please connect your user account to WordPress.com', 'jetpack' ), 404 );
160
				}
161
				return new WP_Error( 'wpcom_connection_error', __( 'Could not connect to WordPress.com', 'jetpack' ), 404 );
162
			}
163
			$data = isset( $response['body'] ) ? json_decode( $response['body'], true ) : null;
164
			if ( ! $connected_account_id ) {
165
				$connect_url = empty( $data['connect_url'] ) ? '' : $data['connect_url'];