Code Duplication    Length = 11-11 lines in 2 locations

includes/class-wc-tracker.php 2 locations

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