Code Duplication    Length = 24-25 lines in 2 locations

includes/payments/class-payments-query.php 2 locations

@@ 722-745 (lines=24) @@
719
	 *
720
	 * @return void
721
	 */
722
	public function give_forms() {
723
724
		if ( empty( $this->args['give_forms'] ) ) {
725
			return;
726
		}
727
728
		$compare = '=';
729
730
		if ( is_array( $this->args['give_forms'] ) ) {
731
			$compare = 'IN';
732
		}
733
734
		$this->__set(
735
			'meta_query',
736
			array(
737
				'key'     => '_give_payment_form_id',
738
				'value'   => $this->args['give_forms'],
739
				'compare' => $compare,
740
			)
741
		);
742
743
		$this->__unset( 'give_forms' );
744
745
	}
746
747
	/**
748
	 * Specific Gateway
@@ 755-779 (lines=25) @@
752
	 *
753
	 * @return void
754
	 */
755
	public function gateway_filter() {
756
757
		if ( empty( $this->args['gateway'] ) ) {
758
			return;
759
		}
760
761
		$compare = '=';
762
763
		if ( is_array( $this->args['gateway'] ) ) {
764
			$compare = 'IN';
765
		}
766
767
		$this->__set(
768
			'meta_query', array(
769
				array(
770
					'key'     => '_give_payment_gateway',
771
					'value'   => $this->args['gateway'],
772
					'compare' => $compare,
773
				),
774
			)
775
		);
776
777
		$this->__unset( 'gateway' );
778
779
	}
780
781
782
	/**