Code Duplication    Length = 24-25 lines in 2 locations

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

@@ 743-766 (lines=24) @@
740
	 *
741
	 * @return void
742
	 */
743
	public function give_forms() {
744
745
		if ( empty( $this->args['give_forms'] ) ) {
746
			return;
747
		}
748
749
		$compare = '=';
750
751
		if ( is_array( $this->args['give_forms'] ) ) {
752
			$compare = 'IN';
753
		}
754
755
		$this->__set(
756
			'meta_query',
757
			array(
758
				'key'     => '_give_payment_form_id',
759
				'value'   => $this->args['give_forms'],
760
				'compare' => $compare,
761
			)
762
		);
763
764
		$this->__unset( 'give_forms' );
765
766
	}
767
768
	/**
769
	 * Specific Gateway
@@ 776-800 (lines=25) @@
773
	 *
774
	 * @return void
775
	 */
776
	public function gateway_filter() {
777
778
		if ( empty( $this->args['gateway'] ) ) {
779
			return;
780
		}
781
782
		$compare = '=';
783
784
		if ( is_array( $this->args['gateway'] ) ) {
785
			$compare = 'IN';
786
		}
787
788
		$this->__set(
789
			'meta_query', array(
790
				array(
791
					'key'     => '_give_payment_gateway',
792
					'value'   => $this->args['gateway'],
793
					'compare' => $compare,
794
				),
795
			)
796
		);
797
798
		$this->__unset( 'gateway' );
799
800
	}
801
802
803
	/**