You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_codes
Versions
Version
PHP
8.3
fakerphp/faker
1.23.1
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:
Integrating an array of valid country codes into FakerPHP. (maybe Payment::$ibanFormats keys ?)
Adjusting the BIC generation logic to select a random valid country code for the relevant positions.
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:
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: