Code Duplication    Length = 13-15 lines in 2 locations

includes/abstracts/abstract-wc-order.php 2 locations

@@ 1426-1440 (lines=15) @@
1423
	 * @param bool $round (default: true).
1424
	 * @return float
1425
	 */
1426
	public function get_line_subtotal( $item, $inc_tax = false, $round = true ) {
1427
		$subtotal = 0;
1428
1429
		if ( is_callable( array( $item, 'get_subtotal' ) ) ) {
1430
			if ( $inc_tax ) {
1431
				$subtotal = $item->get_subtotal() + $item->get_subtotal_tax();
1432
			} else {
1433
				$subtotal = $item->get_subtotal();
1434
			}
1435
1436
			$subtotal = $round ? round( $subtotal, wc_get_price_decimals() ) : $subtotal;
1437
		}
1438
1439
		return apply_filters( 'woocommerce_order_amount_line_subtotal', $subtotal, $this, $item, $inc_tax, $round );
1440
	}
1441
1442
	/**
1443
	 * Calculate item cost - useful for gateways.
@@ 1474-1486 (lines=13) @@
1471
	 * @param bool $round (default: true).
1472
	 * @return float
1473
	 */
1474
	public function get_line_total( $item, $inc_tax = false, $round = true ) {
1475
		$total = 0;
1476
1477
		if ( is_callable( array( $item, 'get_total' ) ) ) {
1478
			// Check if we need to add line tax to the line total.
1479
			$total = $inc_tax ? $item->get_total() + $item->get_total_tax() : $item->get_total();
1480
1481
			// Check if we need to round.
1482
			$total = $round ? round( $total, wc_get_price_decimals() ) : $total;
1483
		}
1484
1485
		return apply_filters( 'woocommerce_order_amount_line_total', $total, $this, $item, $inc_tax, $round );
1486
	}
1487
1488
	/**
1489
	 * Get item tax - useful for gateways.