Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 976-986 (lines=11) @@
973
		$args = wp_parse_args( $args, $default_args );
974
975
		// BW compatibility with old args
976
		if ( isset( $args['totals'] ) ) {
977
			foreach ( $args['totals'] as $key => $value ) {
978
				if ( 'tax' === $key ) {
979
					$args['total_tax'] = $value;
980
				} elseif ( 'tax_data' === $key ) {
981
					$args['taxes'] = $value;
982
				} else {
983
					$args[ $key ] = $value;
984
				}
985
			}
986
		}
987
988
		$item = new WC_Order_Item_Product( $args );
989
		$item->set_backorder_meta();

includes/legacy/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'] ) ) {