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

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