Code Duplication    Length = 4-4 lines in 2 locations

includes/abstracts/abstract-wc-order.php 1 location

@@ 1281-1284 (lines=4) @@
1278
1279
			$code = $tax[ 'name' ];
1280
1281
			if ( ! isset( $tax_totals[ $code ] ) ) {
1282
				$tax_totals[ $code ] = new stdClass();
1283
				$tax_totals[ $code ]->amount = 0;
1284
			}
1285
1286
			$tax_totals[ $code ]->id                = $key;
1287
			$tax_totals[ $code ]->rate_id           = $tax['rate_id'];

includes/class-wc-cart.php 1 location

@@ 765-768 (lines=4) @@
762
				$code = WC_Tax::get_rate_code( $key );
763
764
				if ( $code || $key === apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) ) {
765
					if ( ! isset( $tax_totals[ $code ] ) ) {
766
						$tax_totals[ $code ] = new stdClass();
767
						$tax_totals[ $code ]->amount = 0;
768
					}
769
					$tax_totals[ $code ]->tax_rate_id       = $key;
770
					$tax_totals[ $code ]->is_compound       = WC_Tax::is_compound( $key );
771
					$tax_totals[ $code ]->label             = WC_Tax::get_rate_label( $key );