Code Duplication    Length = 14-14 lines in 2 locations

includes/class-give-db-donors.php 2 locations

@@ 298-311 (lines=14) @@
295
	 *
296
	 * @return bool
297
	 */
298
	public function increment_stats( $donor_id = 0, $amount = 0.00 ) {
299
300
		$donor = new Give_Donor( $donor_id );
301
302
		if ( empty( $donor->id ) ) {
303
			return false;
304
		}
305
306
		$increased_count = $donor->increase_purchase_count();
307
		$increased_value = $donor->increase_value( $amount );
308
309
		return ( $increased_count && $increased_value ) ? true : false;
310
311
	}
312
313
	/**
314
	 * Decrements donor's donation stats.
@@ 324-337 (lines=14) @@
321
	 *
322
	 * @return bool
323
	 */
324
	public function decrement_stats( $donor_id = 0, $amount = 0.00 ) {
325
326
		$donor = new Give_Donor( $donor_id );
327
328
		if ( ! $donor ) {
329
			return false;
330
		}
331
332
		$decreased_count = $donor->decrease_donation_count();
333
		$decreased_value = $donor->decrease_value( $amount );
334
335
		return ( $decreased_count && $decreased_value ) ? true : false;
336
337
	}
338
339
	/**
340
	 * Updates the email address of a donor record when the email on a user is updated