Code Duplication    Length = 13-15 lines in 2 locations

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

@@ 1316-1330 (lines=15) @@
1313
	 * @param bool $round (default: true).
1314
	 * @return float
1315
	 */
1316
	public function get_line_subtotal( $item, $inc_tax = false, $round = true ) {
1317
		$subtotal = 0;
1318
1319
		if ( is_callable( array( $item, 'get_subtotal' ) ) ) {
1320
			if ( $inc_tax ) {
1321
				$subtotal = $item->get_subtotal() + $item->get_subtotal_tax();
1322
			} else {
1323
				$subtotal = $item->get_subtotal();
1324
			}
1325
1326
			$subtotal = $round ? round( $subtotal, wc_get_price_decimals() ) : $subtotal;
1327
		}
1328
1329
		return apply_filters( 'woocommerce_order_amount_line_subtotal', $subtotal, $this, $item, $inc_tax, $round );
1330
	}
1331
1332
	/**
1333
	 * Calculate item cost - useful for gateways.
@@ 1364-1376 (lines=13) @@
1361
	 * @param bool $round (default: true).
1362
	 * @return float
1363
	 */
1364
	public function get_line_total( $item, $inc_tax = false, $round = true ) {
1365
		$total = 0;
1366
1367
		if ( is_callable( array( $item, 'get_total' ) ) ) {
1368
			// Check if we need to add line tax to the line total.
1369
			$total = $inc_tax ? $item->get_total() + $item->get_total_tax() : $item->get_total();
1370
1371
			// Check if we need to round.
1372
			$total = $round ? round( $total, wc_get_price_decimals() ) : $total;
1373
		}
1374
1375
		return apply_filters( 'woocommerce_order_amount_line_total', $total, $this, $item, $inc_tax, $round );
1376
	}
1377
1378
	/**
1379
	 * Get item tax - useful for gateways.