Code Duplication    Length = 13-15 lines in 2 locations

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

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