Feature: phoneNumber without extension (en_US)
MGatner opened this issue · 2 comments
After running into this with the second major identity provider (Stripe first, now Google Firebase) I believe and option for a US phone number that never includes an extension is in order. Both of these providers occasionally reject phone numbers generated by Faker\Provider\en_US\PhoneNumber
because of the length of inclusion of the "x".
I do not think that this should be fakers job, But you can use libphonenumber to fix it in your code
That works but adds an entire validation library. It may or may not be Faker's job but the phoneNumber provider is already pretty sparse so it doesn't seem like a bad addition. Other providers break the components of the data into parts, e.g.: streetName
, streetSuffix
, streetAddress
so you can fake the portion(s) needed for a particular scenario. This would essentially be the same thing for phone numbers, especially considering that extensions are non-standard.