Code Duplication    Length = 12-12 lines in 2 locations

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

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