Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 139-149 (lines=11) @@
136
		}
137
138
		// BW compatibility with old args
139
		if ( isset( $args['totals'] ) ) {
140
			foreach ( $args['totals'] as $key => $value ) {
141
				if ( 'tax' === $key ) {
142
					$args['total_tax'] = $value;
143
				} elseif ( 'tax_data' === $key ) {
144
					$args['taxes'] = $value;
145
				} else {
146
					$args[ $key ] = $value;
147
				}
148
			}
149
		}
150
151
		// Handly qty if set
152
		if ( isset( $args['qty'] ) ) {

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

@@ 998-1008 (lines=11) @@
995
		$args = wp_parse_args( $args, $default_args );
996
997
		// BW compatibility with old args
998
		if ( isset( $args['totals'] ) ) {
999
			foreach ( $args['totals'] as $key => $value ) {
1000
				if ( 'tax' === $key ) {
1001
					$args['total_tax'] = $value;
1002
				} elseif ( 'tax_data' === $key ) {
1003
					$args['taxes'] = $value;
1004
				} else {
1005
					$args[ $key ] = $value;
1006
				}
1007
			}
1008
		}
1009
1010
		$item = new WC_Order_Item_Product( $args );
1011
		$item->set_backorder_meta();