Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 916-927 (lines=12) @@
913
		$billing_state    = ! empty( $_POST['billing_state'] ) ? wc_clean( $_POST['billing_state'] ) : '';
914
		$shipping_state   = ! empty( $_POST['shipping_state'] ) ? wc_clean( $_POST['shipping_state'] ) : '';
915
916
		if ( $billing_state && $billing_country ) {
917
			$valid_states = WC()->countries->get_states( $billing_country );
918
919
			// Valid states found for country.
920
			if ( ! empty( $valid_states ) && is_array( $valid_states ) && sizeof( $valid_states ) > 0 ) {
921
				foreach ( $valid_states as $state_abbr => $state ) {
922
					if ( preg_match( '/' . preg_quote( $state ) . '/i', $billing_state ) ) {
923
						$_POST['billing_state'] = $state_abbr;
924
					}
925
				}
926
			}
927
		}
928
929
		if ( $shipping_state && $shipping_country ) {
930
			$valid_states = WC()->countries->get_states( $shipping_country );
@@ 929-940 (lines=12) @@
926
			}
927
		}
928
929
		if ( $shipping_state && $shipping_country ) {
930
			$valid_states = WC()->countries->get_states( $shipping_country );
931
932
			// Valid states found for country.
933
			if ( ! empty( $valid_states ) && is_array( $valid_states ) && sizeof( $valid_states ) > 0 ) {
934
				foreach ( $valid_states as $state_abbr => $state ) {
935
					if ( preg_match( '/' . preg_quote( $state ) . '/i', $shipping_state ) ) {
936
						$_POST['shipping_state'] = $state_abbr;
937
					}
938
				}
939
			}
940
		}
941
	}
942
943
	/**