Code Duplication    Length = 13-15 lines in 2 locations

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

@@ 1327-1341 (lines=15) @@
1324
	 * @param bool $round (default: true).
1325
	 * @return float
1326
	 */
1327
	public function get_line_subtotal( $item, $inc_tax = false, $round = true ) {
1328
		$subtotal = 0;
1329
1330
		if ( is_callable( array( $item, 'get_subtotal' ) ) ) {
1331
			if ( $inc_tax ) {
1332
				$subtotal = $item->get_subtotal() + $item->get_subtotal_tax();
1333
			} else {
1334
				$subtotal = $item->get_subtotal();
1335
			}
1336
1337
			$subtotal = $round ? round( $subtotal, wc_get_price_decimals() ) : $subtotal;
1338
		}
1339
1340
		return apply_filters( 'woocommerce_order_amount_line_subtotal', $subtotal, $this, $item, $inc_tax, $round );
1341
	}
1342
1343
	/**
1344
	 * Calculate item cost - useful for gateways.
@@ 1375-1387 (lines=13) @@
1372
	 * @param bool $round (default: true).
1373
	 * @return float
1374
	 */
1375
	public function get_line_total( $item, $inc_tax = false, $round = true ) {
1376
		$total = 0;
1377
1378
		if ( is_callable( array( $item, 'get_total' ) ) ) {
1379
			// Check if we need to add line tax to the line total.
1380
			$total = $inc_tax ? $item->get_total() + $item->get_total_tax() : $item->get_total();
1381
1382
			// Check if we need to round.
1383
			$total = $round ? round( $total, wc_get_price_decimals() ) : $total;
1384
		}
1385
1386
		return apply_filters( 'woocommerce_order_amount_line_total', $total, $this, $item, $inc_tax, $round );
1387
	}
1388
1389
	/**
1390
	 * Get item tax - useful for gateways.