Code Duplication    Length = 3-3 lines in 4 locations

includes/payments/class-give-donation-stats.php 4 locations

@@ 480-482 (lines=3) @@
477
		$this->query_vars['where_sql'][] = $this->get_db()->prepare( "AND {$this->get_db()->posts}.post_type=%s", 'give_payment' );
478
479
		// Date sql.
480
		if ( $this->query_vars["start_date"] ) {
481
			$this->query_vars['date_sql'][] = "AND {$this->get_db()->posts}.post_date>='{$this->query_vars["start_date"]->format('mysql')}'";
482
		}
483
484
		if ( $this->query_vars["end_date"] ) {
485
			$this->query_vars['date_sql'][] = "AND {$this->get_db()->posts}.post_date<='{$this->query_vars["end_date"]->format('mysql')}'";
@@ 484-486 (lines=3) @@
481
			$this->query_vars['date_sql'][] = "AND {$this->get_db()->posts}.post_date>='{$this->query_vars["start_date"]->format('mysql')}'";
482
		}
483
484
		if ( $this->query_vars["end_date"] ) {
485
			$this->query_vars['date_sql'][] = "AND {$this->get_db()->posts}.post_date<='{$this->query_vars["end_date"]->format('mysql')}'";
486
		}
487
488
		// Relative date query.
489
		if ( $this->query_vars['range'] ) {
@@ 490-492 (lines=3) @@
487
488
		// Relative date query.
489
		if ( $this->query_vars['range'] ) {
490
			if ( $this->query_vars["relative_start_date"] ) {
491
				$this->query_vars['relative_date_sql'][] = "AND {$this->get_db()->posts}.post_date>='{$this->query_vars["relative_start_date"]->format('mysql')}'";
492
			}
493
494
			if ( $this->query_vars["relative_end_date"] ) {
495
				$this->query_vars['relative_date_sql'][] = "AND {$this->get_db()->posts}.post_date<='{$this->query_vars["relative_end_date"]->format('mysql')}'";
@@ 494-496 (lines=3) @@
491
				$this->query_vars['relative_date_sql'][] = "AND {$this->get_db()->posts}.post_date>='{$this->query_vars["relative_start_date"]->format('mysql')}'";
492
			}
493
494
			if ( $this->query_vars["relative_end_date"] ) {
495
				$this->query_vars['relative_date_sql'][] = "AND {$this->get_db()->posts}.post_date<='{$this->query_vars["relative_end_date"]->format('mysql')}'";
496
			}
497
		}
498
499
		// Add sql for specific donation form.