Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 363-376 (lines=14) @@
360
	 *
361
	 * @return bool
362
	 */
363
	public function increment_stats( $donor_id = 0, $amount = 0.00 ) {
364
365
		$donor = new Give_Donor( $donor_id );
366
367
		if ( empty( $donor->id ) ) {
368
			return false;
369
		}
370
371
		$increased_count = $donor->increase_purchase_count();
372
		$increased_value = $donor->increase_value( $amount );
373
374
		return ( $increased_count && $increased_value ) ? true : false;
375
376
	}
377
378
	/**
379
	 * Decrements donor's donation stats.
@@ 389-402 (lines=14) @@
386
	 *
387
	 * @return bool
388
	 */
389
	public function decrement_stats( $donor_id = 0, $amount = 0.00 ) {
390
391
		$donor = new Give_Donor( $donor_id );
392
393
		if ( ! $donor ) {
394
			return false;
395
		}
396
397
		$decreased_count = $donor->decrease_donation_count();
398
		$decreased_value = $donor->decrease_value( $amount );
399
400
		return ( $decreased_count && $decreased_value ) ? true : false;
401
402
	}
403
404
	/**
405
	 * Retrieves a single donor from the database