Code Duplication    Length = 3-3 lines in 2 locations

includes/api/class-wc-api-coupons.php 1 location

@@ 428-430 (lines=3) @@
425
				update_post_meta( $id, 'product_categories', array_filter( array_map( 'intval', $data['product_category_ids'] ) ) );
426
			}
427
428
			if ( isset( $data['exclude_product_category_ids'] ) ) {
429
				update_post_meta( $id, 'exclude_product_categories', array_filter( array_map( 'intval', $data['exclude_product_category_ids'] ) ) );
430
			}
431
432
			if ( isset( $data['exclude_sale_items'] ) ) {
433
				update_post_meta( $id, 'exclude_sale_items', ( true === $data['exclude_sale_items'] ) ? 'yes' : 'no' );

includes/cli/class-wc-cli-coupon.php 1 location

@@ 518-520 (lines=3) @@
515
				update_post_meta( $id, 'product_categories', array_filter( array_map( 'intval', $data['product_category_ids'] ) ) );
516
			}
517
518
			if ( isset( $data['exclude_product_category_ids'] ) ) {
519
				update_post_meta( $id, 'exclude_product_categories', array_filter( array_map( 'intval', $data['exclude_product_category_ids'] ) ) );
520
			}
521
522
			if ( isset( $data['exclude_sale_items'] ) ) {
523
				update_post_meta( $id, 'exclude_sale_items', ( true === $data['exclude_sale_items'] ) ? 'yes' : 'no' );