Code Duplication    Length = 3-3 lines in 4 locations

includes/class-wc-cart.php 3 locations

@@ 1293-1295 (lines=3) @@
1290
					}
1291
1292
					// Tax rows - merge the totals we just got
1293
					foreach ( array_keys( $this->taxes + $discounted_taxes ) as $key ) {
1294
						$this->taxes[ $key ] = ( isset( $discounted_taxes[ $key ] ) ? $discounted_taxes[ $key ] : 0 ) + ( isset( $this->taxes[ $key ] ) ? $this->taxes[ $key ] : 0 );
1295
					}
1296
1297
				/**
1298
				 * Prices exclude tax.
@@ 1319-1321 (lines=3) @@
1316
					$line_total            = $discounted_price * $values['quantity'];
1317
1318
					// Tax rows - merge the totals we just got
1319
					foreach ( array_keys( $this->taxes + $discounted_taxes ) as $key ) {
1320
						$this->taxes[ $key ] = ( isset( $discounted_taxes[ $key ] ) ? $discounted_taxes[ $key ] : 0 ) + ( isset( $this->taxes[ $key ] ) ? $this->taxes[ $key ] : 0 );
1321
					}
1322
				}
1323
1324
				// Cart contents total is based on discounted prices and is used for the final total calculation
@@ 1981-1983 (lines=3) @@
1978
							$this->fees[ $fee_key ]->tax_data = $fee_taxes;
1979
1980
							// Tax rows - merge the totals we just got
1981
							foreach ( array_keys( $this->taxes + $fee_taxes ) as $key ) {
1982
								$this->taxes[ $key ] = ( isset( $fee_taxes[ $key ] ) ? $fee_taxes[ $key ] : 0 ) + ( isset( $this->taxes[ $key ] ) ? $this->taxes[ $key ] : 0 );
1983
							}
1984
						}
1985
					}
1986
				}

includes/class-wc-shipping.php 1 location

@@ 280-282 (lines=3) @@
277
					$this->shipping_total += $rate->cost;
278
279
					if ( ! empty( $rate->taxes ) && is_array( $rate->taxes ) ) {
280
						foreach ( array_keys( $this->shipping_taxes + $rate->taxes ) as $key ) {
281
							$this->shipping_taxes[ $key ] = ( isset( $rate->taxes[$key] ) ? $rate->taxes[$key] : 0 ) + ( isset( $this->shipping_taxes[$key] ) ? $this->shipping_taxes[$key] : 0 );
282
						}
283
					}
284
				}
285
			}