Code Duplication    Length = 9-9 lines in 2 locations

includes/class-wc-cart-totals.php 2 locations

@@ 453-461 (lines=9) @@
450
	public function get_merged_taxes() {
451
		$taxes = array();
452
453
		foreach ( $this->items as $item ) {
454
			foreach ( $item->taxes as $rate_id => $rate ) {
455
				if ( ! isset( $taxes[ $rate_id ] ) ) {
456
					$taxes[ $rate_id ] = new WC_Item_Tax();
457
				}
458
				$taxes[ $rate_id ]->set_rate( $rate_id );
459
				$taxes[ $rate_id ]->set_tax_total( $taxes[ $rate_id ]->get_tax_total() + $rate );
460
			}
461
		}
462
463
		foreach ( $this->shipping_lines as $item ) {
464
			foreach ( $item->taxes as $rate_id => $rate ) {
@@ 463-471 (lines=9) @@
460
			}
461
		}
462
463
		foreach ( $this->shipping_lines as $item ) {
464
			foreach ( $item->taxes as $rate_id => $rate ) {
465
				if ( ! isset( $taxes[ $rate_id ] ) ) {
466
					$taxes[ $rate_id ] = new WC_Item_Tax();
467
				}
468
				$taxes[ $rate_id ]->set_rate( $rate_id );
469
				$taxes[ $rate_id ]->set_shipping_tax_total( $taxes[ $rate_id ]->get_shipping_tax_total() + $rate );
470
			}
471
		}
472
473
		return $taxes;
474
	}