Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 750-758 (lines=9) @@
747
	private function get_merged_taxes() {
748
		$taxes = array();
749
750
		foreach ( $this->items as $item ) {
751
			foreach ( $item->taxes as $rate_id => $rate ) {
752
				if ( ! isset( $taxes[ $rate_id ] ) ) {
753
					$taxes[ $rate_id ] = new WC_Item_Tax();
754
				}
755
				$taxes[ $rate_id ]->set_rate( $rate_id );
756
				$taxes[ $rate_id ]->set_tax_total( $taxes[ $rate_id ]->get_tax_total() + $rate );
757
			}
758
		}
759
760
		foreach ( $this->shipping_lines as $item ) {
761
			foreach ( $item->taxes as $rate_id => $rate ) {
@@ 760-768 (lines=9) @@
757
			}
758
		}
759
760
		foreach ( $this->shipping_lines as $item ) {
761
			foreach ( $item->taxes as $rate_id => $rate ) {
762
				if ( ! isset( $taxes[ $rate_id ] ) ) {
763
					$taxes[ $rate_id ] = new WC_Item_Tax();
764
				}
765
				$taxes[ $rate_id ]->set_rate( $rate_id );
766
				$taxes[ $rate_id ]->set_shipping_tax_total( $taxes[ $rate_id ]->get_shipping_tax_total() + $rate );
767
			}
768
		}
769
770
		return $taxes;
771
	}