Code Duplication    Length = 10-10 lines in 2 locations

includes/class-give-donor.php 1 location

@@ 966-975 (lines=10) @@
963
		if ( ! give_has_upgrade_completed( 'v230_move_donor_note' ) ) {
964
			// Backward compatibility.
965
			$updated = $this->update( array( 'notes' => $notes ) );
966
		} else {
967
			$updated = Give()->comment->db->add(
968
				array(
969
					'comment_content' => $note,
970
					'user_id'         => get_current_user_id(),
971
					'comment_parent'  => $this->id,
972
					'comment_type'    => 'donor',
973
				)
974
			);
975
		}
976
977
		if ( $updated ) {
978
			$this->notes = $this->get_notes();

includes/admin/payments/actions.php 1 location

@@ 409-418 (lines=10) @@
406
	if ( ! give_has_upgrade_completed( 'v230_move_donor_note' ) ) {
407
		// Backward compatibility.
408
		$note_id = give_insert_payment_note( $payment_id, $note );
409
	} else {
410
		$note_id = Give()->comment->db->add(
411
			array(
412
				'comment_parent'  => $payment_id,
413
				'user_id'         => get_current_user_id(),
414
				'comment_content' => $note,
415
				'comment_type'    => 'donation',
416
			)
417
		);
418
	}
419
420
	if( $note_id && $note_type ) {
421