forked from fzaninotto/Faker
-
Notifications
You must be signed in to change notification settings - Fork 361
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
swiftBicNumber() generates BIC codes with invalid country codes #902
Comments
vjandrea
added a commit
to vjandrea/Faker
that referenced
this issue
Dec 8, 2024
- swiftBicNumber now accepts an optional $countryCode argument to localize the generated value - using Symfony Validator in tests
7 tasks
vjandrea
added a commit
to vjandrea/Faker
that referenced
this issue
Dec 9, 2024
- swiftBicNumber now accepts an optional $countryCode argument to localize the generated value - using Symfony Validator in tests
vjandrea
added a commit
to vjandrea/Faker
that referenced
this issue
Dec 9, 2024
- swiftBicNumber now accepts an optional $countryCode argument to localize the generated value - using Symfony Validator in tests
vjandrea
added a commit
to vjandrea/Faker
that referenced
this issue
Dec 9, 2024
- swiftBicNumber now accepts an optional $countryCode argument to localize the generated value - using Symfony Validator in tests
vjandrea
added a commit
to vjandrea/Faker
that referenced
this issue
Dec 9, 2024
- swiftBicNumber now accepts an optional $countryCode argument to localize the generated value - using Symfony Validator in tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
The
swiftBicNumber()
function in FakerPHP generates BIC codes where the 5th and 6th characters, which should represent a valid country code according to the ISO 3166-1 alpha-2 standard, are entirely random.This leads to validation failures when using validators that check for valid country codes in BICs, such as the one provided by Symfony (
#[Assert\Bic]
) based on a full table of ISO 3166 country codes that can be found here: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codesVersions
fakerphp/faker
Possible solution:
Modify the
swiftBicNumber()
function to generate the country code segment (positions 5 and 6) using a list of valid ISO 3166-1 alpha-2 country codes. This could involve:Payment::$ibanFormats
keys ?)Thank you for addressing this issue. Please let me know if you require any further information.
The text was updated successfully, but these errors were encountered: