Code Duplication    Length = 9-10 lines in 2 locations

includes/class-wc-cart.php 2 locations

@@ 411-420 (lines=10) @@
408
			foreach ( $this->applied_coupons as $code ) {
409
				$coupon = new WC_Coupon( $code );
410
411
				if ( ! $coupon->is_valid() ) {
412
					// Error message
413
					$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_INVALID_REMOVED );
414
415
					// Remove the coupon
416
					$this->remove_coupon( $code );
417
418
					// Flag totals for refresh
419
					WC()->session->set( 'refresh_totals', true );
420
				}
421
			}
422
		}
423
@@ 1650-1658 (lines=9) @@
1647
								$usage_count = $usage_count + sizeof( array_keys( $used_by, $check_email ) );
1648
							}
1649
1650
							if ( $usage_count >= $coupon->usage_limit_per_user ) {
1651
								$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED );
1652
1653
								// Remove the coupon
1654
								$this->remove_coupon( $code );
1655
1656
								// Flag totals for refresh
1657
								WC()->session->set( 'refresh_totals', true );
1658
							}
1659
						}
1660
					}
1661
				}