Code Duplication    Length = 11-11 lines in 2 locations

includes/abstracts/abstract-wc-legacy-order.php 1 location

@@ 42-52 (lines=11) @@
39
		}
40
41
		// BW compatibility with old args
42
		if ( isset( $args['totals'] ) ) {
43
			foreach ( $args['totals'] as $key => $value ) {
44
				if ( 'tax' === $key ) {
45
					$args['total_tax'] = $value;
46
				} elseif ( 'tax_data' === $key ) {
47
					$args['taxes'] = $value;
48
				} else {
49
					$args[ $key ] = $value;
50
				}
51
			}
52
		}
53
54
		// Handly qty if set
55
		if ( isset( $args['qty'] ) ) {

includes/abstracts/abstract-wc-order.php 1 location

@@ 1067-1077 (lines=11) @@
1064
		) );
1065
1066
		// BW compatibility with old args
1067
		if ( isset( $args['totals'] ) ) {
1068
			foreach ( $args['totals'] as $key => $value ) {
1069
				if ( 'tax' === $key ) {
1070
					$args['total_tax'] = $value;
1071
				} elseif ( 'tax_data' === $key ) {
1072
					$args['taxes'] = $value;
1073
				} else {
1074
					$args[ $key ] = $value;
1075
				}
1076
			}
1077
		}
1078
1079
		$item = new WC_Order_Item_Product( $args );
1080
		$item->set_backorder_meta();