Code Duplication    Length = 21-21 lines in 2 locations

includes/admin/class-wc-stripe-privacy.php 2 locations

@@ 114-134 (lines=21) @@
111
112
		$done = true;
113
114
		if ( 0 < count( $orders ) ) {
115
			foreach ( $orders as $order ) {
116
				$data_to_export[] = array(
117
					'group_id'    => 'woocommerce_orders',
118
					'group_label' => __( 'Orders', 'woocommerce-gateway-stripe' ),
119
					'item_id'     => 'order-' . $order->get_id(),
120
					'data'        => array(
121
						array(
122
							'name'  => __( 'Stripe payment id', 'woocommerce-gateway-stripe' ),
123
							'value' => get_post_meta( $order->get_id(), '_stripe_source_id', true ),
124
						),
125
						array(
126
							'name'  => __( 'Stripe customer id', 'woocommerce-gateway-stripe' ),
127
							'value' => get_post_meta( $order->get_id(), '_stripe_customer_id', true ),
128
						),
129
					),
130
				);
131
			}
132
133
			$done = 10 > count( $orders );
134
		}
135
136
		return array(
137
			'data' => $data_to_export,
@@ 179-199 (lines=21) @@
176
177
		$done = true;
178
179
		if ( 0 < count( $subscriptions ) ) {
180
			foreach ( $subscriptions as $subscription ) {
181
				$data_to_export[] = array(
182
					'group_id'    => 'woocommerce_subscriptions',
183
					'group_label' => __( 'Subscriptions', 'woocommerce-gateway-stripe' ),
184
					'item_id'     => 'subscription-' . $subscription->get_id(),
185
					'data'        => array(
186
						array(
187
							'name'  => __( 'Stripe payment id', 'woocommerce-gateway-stripe' ),
188
							'value' => get_post_meta( $subscription->get_id(), '_stripe_source_id', true ),
189
						),
190
						array(
191
							'name'  => __( 'Stripe customer id', 'woocommerce-gateway-stripe' ),
192
							'value' => get_post_meta( $subscription->get_id(), '_stripe_customer_id', true ),
193
						),
194
					),
195
				);
196
			}
197
198
			$done = 10 > count( $subscriptions );
199
		}
200
201
		return array(
202
			'data' => $data_to_export,