Code Duplication    Length = 12-12 lines in 2 locations

includes/payment-methods/class-wc-stripe-payment-request.php 2 locations

@@ 852-863 (lines=12) @@
849
		$billing_state    = ! empty( $_POST['billing_state'] ) ? wc_clean( $_POST['billing_state'] ) : '';
850
		$shipping_state   = ! empty( $_POST['shipping_state'] ) ? wc_clean( $_POST['shipping_state'] ) : '';
851
852
		if ( $billing_state && $billing_country ) {
853
			$valid_states = WC()->countries->get_states( $billing_country );
854
855
			// Valid states found for country.
856
			if ( ! empty( $valid_states ) && is_array( $valid_states ) && sizeof( $valid_states ) > 0 ) {
857
				foreach ( $valid_states as $state_abbr => $state ) {
858
					if ( preg_match( '/' . preg_quote( $state ) . '/i', $billing_state ) ) {
859
						$_POST['billing_state'] = $state_abbr;
860
					}
861
				}
862
			}
863
		}
864
865
		if ( $shipping_state && $shipping_country ) {
866
			$valid_states = WC()->countries->get_states( $shipping_country );
@@ 865-876 (lines=12) @@
862
			}
863
		}
864
865
		if ( $shipping_state && $shipping_country ) {
866
			$valid_states = WC()->countries->get_states( $shipping_country );
867
868
			// Valid states found for country.
869
			if ( ! empty( $valid_states ) && is_array( $valid_states ) && sizeof( $valid_states ) > 0 ) {
870
				foreach ( $valid_states as $state_abbr => $state ) {
871
					if ( preg_match( '/' . preg_quote( $state ) . '/i', $shipping_state ) ) {
872
						$_POST['shipping_state'] = $state_abbr;
873
					}
874
				}
875
			}
876
		}
877
	}
878
879
	/**