Code Duplication    Length = 13-15 lines in 2 locations

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

@@ 1345-1359 (lines=15) @@
1342
	 * @param bool $round (default: true).
1343
	 * @return float
1344
	 */
1345
	public function get_line_subtotal( $item, $inc_tax = false, $round = true ) {
1346
		$subtotal = 0;
1347
1348
		if ( is_callable( array( $item, 'get_subtotal' ) ) ) {
1349
			if ( $inc_tax ) {
1350
				$subtotal = $item->get_subtotal() + $item->get_subtotal_tax();
1351
			} else {
1352
				$subtotal = $item->get_subtotal();
1353
			}
1354
1355
			$subtotal = $round ? round( $subtotal, wc_get_price_decimals() ) : $subtotal;
1356
		}
1357
1358
		return apply_filters( 'woocommerce_order_amount_line_subtotal', $subtotal, $this, $item, $inc_tax, $round );
1359
	}
1360
1361
	/**
1362
	 * Calculate item cost - useful for gateways.
@@ 1393-1405 (lines=13) @@
1390
	 * @param bool $round (default: true).
1391
	 * @return float
1392
	 */
1393
	public function get_line_total( $item, $inc_tax = false, $round = true ) {
1394
		$total = 0;
1395
1396
		if ( is_callable( array( $item, 'get_total' ) ) ) {
1397
			// Check if we need to add line tax to the line total.
1398
			$total = $inc_tax ? $item->get_total() + $item->get_total_tax() : $item->get_total();
1399
1400
			// Check if we need to round.
1401
			$total = $round ? round( $total, wc_get_price_decimals() ) : $total;
1402
		}
1403
1404
		return apply_filters( 'woocommerce_order_amount_line_total', $total, $this, $item, $inc_tax, $round );
1405
	}
1406
1407
	/**
1408
	 * Get item tax - useful for gateways.