-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add hasPattern to Validator #40
Comments
Let me know if you accept pull requests? Dont want to waste time... :) |
Perhaps we should throw an Currently the library assumes that the validation method is only called after the |
This would require a new major version since it's a BC break. Also, every support of new countries could be considered as a BC break like Maybe we should let the behavior be decided by the user, with public function validateVatNumberFormat(string $vatNumber, bool $failIfUnknown = true): bool
{
// ...
if (! isset($this->patterns[$country])) {
return !$failIfUnknown;
}
// ...
} Still, exposing a method to know if the Vat country is supported could be useful
If so, there is currently no call in the VatBundle And the methods/constraints are called |
Somewhat within the same scope i would love to be able to get the patterns themselves per country in some way. |
being able to check if here is a pattern for a country would it possible to add fx VAT number format check for Norway
so I could first do a check for "hasPattern" and then call the validateVatNumberFormat if hasPattern returned true
Today all numbers from Norway return false due to this check:
The text was updated successfully, but these errors were encountered: