Code Duplication    Length = 11-11 lines in 2 locations

includes/class-wc-tracker.php 2 locations

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