-
Notifications
You must be signed in to change notification settings - Fork 772
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 (German) bank account validation with malkusch/bav #188
Conversation
German bank validation has more than 100 validation rules. I'm too lazy to extend the validation for other countries. I will rebase if there is demand for a german bank validation. |
I didn't say you have to extend the validation for other countries. What I'm trying to avoid is to have |
Ok, Sorry I got you wrong. This sounds of course reasonable. I'll rebase and refactor the validator to a universal API with a country code dependency. |
Thanks 😄 |
Rebased to master and refactored to |
Thanks, @malkusch, now I can review it! Fist of all, you should fix the detected issues on the Scrutinizer's build. I will start to review it now. |
|
||
* "de" (Germany) | ||
|
||
This validator needs `malkusch/bav` as dependency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a dependency of de
only, so I think you should put it on the same line of de
.
If you use I have to think about something better but now my headache doesn't let me do it. 😫 |
Yes, that comes with the universal validator which gets only the country code injected. You probably want to keep the API clean and simple i.e. prefer |
I have to think more about it, my first thought was |
Any way, it's not a blocker, we can refactor it, since we have a clean API. @malkusch, just move the validation to the rules' constructors and, if you don't mind, squash these commits (there are too many of them for just 3 rules) and I guess we can merge it as it is. |
Refactored and squashed. |
$callback = function ($bic) use ($bav) { | ||
return $bav->isValidBIC($bic); | ||
}; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not?
$callback = array(new BAV(), 'isValidBIC');
$bav = new BAV(); | ||
$callback = function ($bank) use ($bav) { | ||
return $bav->isValidBank($bank); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Thanks for all your work!! |
Add (German) bank account validation with malkusch/bav
Hi
I maintain the library malkusch/bav for validation of German bank accounts. This pull requests adds following rules to include bav into your library:
v::germanBank()
v::germanBankAccount()
v::germanBIC()
v::bank(string $countryCode)
v::bankAccount(string $countryCode, string $bank)
v::bic(string $countryCode)
This PR supports only the country code "de".
Enjoy.