Code Duplication    Length = 8-9 lines in 2 locations

includes/cli/class-wc-cli-order.php 1 location

@@ 729-736 (lines=8) @@
726
		}
727
728
		// Add shipping.
729
		foreach ( $order->get_shipping_methods() as $shipping_item_id => $shipping_item ) {
730
			$order_data['shipping_lines'][] = array(
731
				'id'           => $shipping_item_id,
732
				'method_id'    => $shipping_item['method_id'],
733
				'method_title' => $shipping_item['name'],
734
				'total'        => wc_format_decimal( $shipping_item['cost'], $dp ),
735
			);
736
		}
737
738
		// Add taxes.
739
		foreach ( $order->get_tax_totals() as $tax_code => $tax ) {

includes/api/class-wc-api-orders.php 1 location

@@ 274-282 (lines=9) @@
271
		}
272
273
		// Add shipping.
274
		foreach ( $order->get_shipping_methods() as $shipping_item_id => $shipping_item ) {
275
			$order_data['shipping_lines'][] = array(
276
				'id'           => $shipping_item_id,
277
				'method_id'    => $shipping_item['method_id'],
278
				'method_title' => $shipping_item['name'],
279
				'total'        => wc_format_decimal( $shipping_item['cost'], $dp ),
280
			);
281
		}
282
283
		// Add taxes.
284
		foreach ( $order->get_tax_totals() as $tax_code => $tax ) {
285
			$tax_line = array(