Code Duplication    Length = 9-10 lines in 2 locations

includes/class-wc-cart.php 2 locations

@@ 407-416 (lines=10) @@
404
			foreach ( $this->applied_coupons as $code ) {
405
				$coupon = new WC_Coupon( $code );
406
407
				if ( ! $coupon->is_valid() ) {
408
					// Error message
409
					$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_INVALID_REMOVED );
410
411
					// Remove the coupon
412
					$this->remove_coupon( $code );
413
414
					// Flag totals for refresh
415
					WC()->session->set( 'refresh_totals', true );
416
				}
417
			}
418
		}
419
@@ 1684-1692 (lines=9) @@
1681
								$usage_count = $usage_count + sizeof( array_keys( $used_by, $check_email ) );
1682
							}
1683
1684
							if ( $usage_count >= $coupon->usage_limit_per_user ) {
1685
								$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED );
1686
1687
								// Remove the coupon
1688
								$this->remove_coupon( $code );
1689
1690
								// Flag totals for refresh
1691
								WC()->session->set( 'refresh_totals', true );
1692
							}
1693
						}
1694
					}
1695
				}