Code Duplication    Length = 11-11 lines in 2 locations

includes/class-wc-tracker.php 2 locations

@@ 311-321 (lines=11) @@
308
	 * Get a list of all active payment gateways.
309
	 * @return array
310
	 */
311
	private static function get_active_payment_gateways() {
312
		$active_gateways = array();
313
		$gateways        = WC()->payment_gateways->payment_gateways();
314
		foreach ( $gateways as $id => $gateway ) {
315
			if ( isset( $gateway->enabled ) && 'yes' === $gateway->enabled ) {
316
				$active_gateways[ $id ] = array( 'title' => $gateway->title, 'supports' => $gateway->supports );
317
			}
318
		}
319
320
		return $active_gateways;
321
	}
322
323
	/**
324
	 * Get a list of all active shipping methods.
@@ 327-337 (lines=11) @@
324
	 * Get a list of all active shipping methods.
325
	 * @return array
326
	 */
327
	private static function get_active_shipping_methods() {
328
		$active_methods   = array();
329
		$shipping_methods = WC()->shipping->get_shipping_methods();
330
		foreach ( $shipping_methods as $id => $shipping_method ) {
331
			if ( isset( $shipping_method->enabled ) && 'yes' === $shipping_method->enabled ) {
332
				$active_methods[ $id ] = array( 'title' => $shipping_method->title, 'tax_status' => $shipping_method->tax_status );
333
			}
334
		}
335
336
		return $active_methods;
337
	}
338
339
	/**
340
	 * Get all options starting with woocommerce_ prefix.