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

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