Code Duplication    Length = 11-11 lines in 2 locations

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

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

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

@@ 900-910 (lines=11) @@
897
		) );
898
899
		// BW compatibility with old args
900
		if ( isset( $args['totals'] ) ) {
901
			foreach ( $args['totals'] as $key => $value ) {
902
				if ( 'tax' === $key ) {
903
					$args['total_tax'] = $value;
904
				} elseif ( 'tax_data' === $key ) {
905
					$args['taxes'] = $value;
906
				} else {
907
					$args[ $key ] = $value;
908
				}
909
			}
910
		}
911
912
		$item = new WC_Order_Item_Product( $args );
913