Code Duplication    Length = 3-3 lines in 4 locations

includes/api/class-wc-api-coupons.php 2 locations

@@ 392-394 (lines=3) @@
389
				update_post_meta( $id, 'individual_use', ( true === $data['individual_use'] ) ? 'yes' : 'no' );
390
			}
391
392
			if ( isset( $data['product_ids'] ) ) {
393
				update_post_meta( $id, 'product_ids', implode( ',', array_filter( array_map( 'intval', $data['product_ids'] ) ) ) );
394
			}
395
396
			if ( isset( $data['exclude_product_ids'] ) ) {
397
				update_post_meta( $id, 'exclude_product_ids', implode( ',', array_filter( array_map( 'intval', $data['exclude_product_ids'] ) ) ) );
@@ 396-398 (lines=3) @@
393
				update_post_meta( $id, 'product_ids', implode( ',', array_filter( array_map( 'intval', $data['product_ids'] ) ) ) );
394
			}
395
396
			if ( isset( $data['exclude_product_ids'] ) ) {
397
				update_post_meta( $id, 'exclude_product_ids', implode( ',', array_filter( array_map( 'intval', $data['exclude_product_ids'] ) ) ) );
398
			}
399
400
			if ( isset( $data['usage_limit'] ) ) {
401
				update_post_meta( $id, 'usage_limit', absint( $data['usage_limit'] ) );

includes/cli/class-wc-cli-coupon.php 2 locations

@@ 482-484 (lines=3) @@
479
				update_post_meta( $id, 'individual_use', ( true === $data['individual_use'] ) ? 'yes' : 'no' );
480
			}
481
482
			if ( isset( $data['product_ids'] ) ) {
483
				update_post_meta( $id, 'product_ids', implode( ',', array_filter( array_map( 'intval', $data['product_ids'] ) ) ) );
484
			}
485
486
			if ( isset( $data['exclude_product_ids'] ) ) {
487
				update_post_meta( $id, 'exclude_product_ids', implode( ',', array_filter( array_map( 'intval', $data['exclude_product_ids'] ) ) ) );
@@ 486-488 (lines=3) @@
483
				update_post_meta( $id, 'product_ids', implode( ',', array_filter( array_map( 'intval', $data['product_ids'] ) ) ) );
484
			}
485
486
			if ( isset( $data['exclude_product_ids'] ) ) {
487
				update_post_meta( $id, 'exclude_product_ids', implode( ',', array_filter( array_map( 'intval', $data['exclude_product_ids'] ) ) ) );
488
			}
489
490
			if ( isset( $data['usage_limit'] ) ) {
491
				update_post_meta( $id, 'usage_limit', absint( $data['usage_limit'] ) );