-
Notifications
You must be signed in to change notification settings - Fork 332
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
Extension-free US phone numbers #18
Comments
Do you have some more info on what is invalid there and what you expect? Please ensure the bugreport is valid as mentioned in the template |
I have had to add regex to strip out the “x5555” from Faker phone numbers just so my tests won’t break. |
@hopeseekr do we even know where the X is for? Looking at the wiki i dont see it existing in any spec. However im not from the regionso for me it is hard to tell |
@pimjansen it indicates an extension, usually not dialed with the phone number but after connecting to a main relay. They are not uncommon but individuals would never have extensions, it is an indicator of a business number. |
So therefor they are valid? |
That depends on who you ask! The reason I opened this issue is that they aren't considered valid by Stripe or Firebase (probably among others). They are never valid programmatically, as in you cannot dial them. However people in the USA would understand what they meant and how to use them, and you may not be able to reach the desired person without the extra info. |
In my opinion the appropriate way to handle these should have been to have |
Well imo a phonenumber is reachable by a phone. Meaning that if it is a number that you can not dial it is not ok and should not be in the output. To keep it simple we ofcourse want to create these numbers at any point. Therefor i think it is best to add a method to generate the numbers that are now considered wrong and update the existing one. Will that work? |
Absolutely! That would be awesome. So to be clear, this would be something like:
|
Yes would work for me |
Summary
Porting this issue because it still matters to me... The current phone number generators have the possibility of producing results considered invalid by Google Firebase and Stripe, among others. This is due mostly to random extensions on
Faker\Provider\en_US\PhoneNumber
which either cause the number to be too long or invalidate it because of the "x" character.Please consider breaking phone numbers out (like
streetName
,streetSuffix
, andstreetAddress
) and/or supporting aPhoneNumberSimple
generator.fzaninotto#1909
Versions
fakerphp/faker
The text was updated successfully, but these errors were encountered: