-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Clear and concise description of the problem
We've had various requests to restrict faker.phone.number() to only return mobile/cellphone numbers e.g. #2883 and #3574
In many locales phone numbers have a fixed format e.g. in en_GB they are always 07##########. It's common for country-specific websites to require a mobile number for signup.
Suggested solution
A new style "mobile" in the faker.phone.number() method which will return a nationally formatted mobile number with no spaces, e.g. 071234512345 for en_GB or 0812345678 for en_ZA.
In locales where this doesn't make sense e.g. en/en_US where cellphone numbers are indistinguishable from landlines, we would not provide data and this would throw.
Alternative
There is some existing data stored in src/*/cell_phone/formats for some locales however
- This is not currently exposed in a method, it's only accessible via faker.fake and is undocumented
- In many cases the data is many years out of date.
The naming could alternatively be say cell
or cellphone
or nationalMobile
Additional context
I have added a sample PR at #3583