-
Notifications
You must be signed in to change notification settings - Fork 367
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
fix: Generate valid BIC/SWIFT numbers (#902) #921
base: 1.24
Are you sure you want to change the base?
Conversation
Im not a fan of just adding new packages to the base of Faker |
I see, I will refactor the test to be package agnostic. |
f1e26fa
to
66660fd
Compare
- swiftBicNumber now accepts an optional $countryCode argument to localize the generated value - using Symfony Validator in tests
@pimjansen I removed the extra dependencies, do you mind to review please? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions. |
@@ -197,4 +197,20 @@ protected function getProviders(): iterable | |||
|
|||
yield new PaymentProvider($this->faker); | |||
} | |||
|
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.
Missing test for an invalid country code
* @return string Swift/Bic number | ||
*/ | ||
public static function swiftBicNumber() | ||
public static function swiftBicNumber($countryCode = null) |
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 bit shady since you have no clue what can be put in here and all can be invalid. I think we have a list of all country codes already in the package. Can you use that to verify it exists?
What is the reason for this PR?
Author's checklist
Summary of changes
swiftBicNumber()
now returns SWIFT/BIC numbers that pass validation.Added a dev requirement for symfony/validator that might be used for other generators as well.
Review checklist
CHANGELOG.md