robertogallea / laravel-codicefiscale

Codice fiscale validation for php/laravel
MIT License
42 stars 16 forks source link

InternationalCitiesStaticList #13

Closed michelepizzi closed 3 years ago

michelepizzi commented 3 years ago

Hi, I noticed that this code doesn't use the InternationalCitiesStaticList class but Italian List. In this case I get errors when checking the CodiceFiscale when I use foreign birth states. For example Z133 from Switzerland.

robertogallea commented 3 years ago

Hi Michele, actually, the code doesn't use CityDecoderInterface implementations to perform validation on the last 4 digits. It uses them only for decoding the birthplace. Are you sure there is not any other problem in your codice fiscale?

Could you please share (perhaps privately the fiscal number) so I could perform some tests?

On Thu, Oct 15, 2020 at 11:38 AM Michele Pizzi notifications@github.com wrote:

Hi, I noticed that this code doesn't use the InternationalCitiesStaticList class but Italian List. In this case I get errors when checking the CodiceFiscale when I use foreign birth states. For example Z133 from Switzerland.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/robertogallea/laravel-codicefiscale/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUDEDXIGJ3GT4VM3M76HY3SK27IXANCNFSM4SRXU7BQ .

michelepizzi commented 3 years ago

Ok, i fix in this way:

$cf = new CodiceFiscale(new InternationalCitiesStaticList());
$cf->parse($value);

So it also adds foreign nations (like Z133) and gives me success