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

@@ 888-898 (lines=11) @@
885
		) );
886
887
		// BW compatibility with old args
888
		if ( isset( $args['totals'] ) ) {
889
			foreach ( $args['totals'] as $key => $value ) {
890
				if ( 'tax' === $key ) {
891
					$args['total_tax'] = $value;
892
				} elseif ( 'tax_data' === $key ) {
893
					$args['taxes'] = $value;
894
				} else {
895
					$args[ $key ] = $value;
896
				}
897
			}
898
		}
899
900
		$item = new WC_Order_Item_Product( $args );
901