Respect / Validation

The most awesome validation engine ever created for PHP
https://respect-validation.readthedocs.io
MIT License
5.76k stars 774 forks source link

New rule: Portuguese NIF (VAT number) #1384

Closed goncalo-andrade closed 1 year ago

goncalo-andrade commented 2 years ago

Hi!

I work in a project where we use Respect/Validation. Something that we regularly have to check for is the validity of a Portuguese fiscal identification number (NIF). Since Validation does not, at this time, have such a validation rule, I decided to contribute one. I hope you find it useful. I named the rule PortugueseNif because there is already a rule called Nif. I'm not sure this is the best name for it, so I ask for your input on this.

I tried to create this pull request in a way that follows Validation's contribution guidelines. However, if anything is not as you would expect, let me know and I'll try to fix it :)

alganet commented 1 year ago

Thanks to you, starting from release 2.2.4, portuguese users will now be able to validate their NIFs 🐼 We appreciate your contribution!