Code Duplication    Length = 15-15 lines in 2 locations

includes/class-give-donor.php 2 locations

@@ 548-562 (lines=15) @@
545
546
		$payment_added = $this->update( array( 'payment_ids' => $new_payment_ids ) );
547
548
		if ( $payment_added ) {
549
550
			$this->payment_ids = $new_payment_ids;
551
552
			// We added this payment successfully, increment the stats
553
			if ( $update_stats ) {
554
				$payment_amount = give_donation_amount( $payment_id, array( 'type' => 'stats' ) );
555
556
				if ( ! empty( $payment_amount ) ) {
557
					$this->increase_value( $payment_amount );
558
				}
559
560
				$this->increase_purchase_count();
561
			}
562
		}
563
564
		/**
565
		 * Fires after attaching payments to the donor.
@@ 633-647 (lines=15) @@
630
631
		$payment_removed = $this->update( array( 'payment_ids' => $new_payment_ids ) );
632
633
		if ( $payment_removed ) {
634
635
			$this->payment_ids = $new_payment_ids;
636
637
			if ( $update_stats ) {
638
				// We removed this payment successfully, decrement the stats
639
				$payment_amount = give_donation_amount( $payment_id );
640
641
				if ( ! empty( $payment_amount ) ) {
642
					$this->decrease_value( $payment_amount );
643
				}
644
645
				$this->decrease_donation_count();
646
			}
647
		}
648
649
		/**
650
		 * Fires after removing payments from donors.