-
Notifications
You must be signed in to change notification settings - Fork 360
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
e164PhoneNumber() generates invalid french Phone Numbers #531
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions. |
In case someone find this thread, we don't use 'e164PhoneNumber' anymore. |
I noticed the same with invalid swiss (de_CH) phone numbers. Would be nice if faker would offer more strict phone number generation. |
@mergeMarc Have you tried generating a number via numerify()? |
I could use numerify but only with the last few digits being random. The application i generate fixtures for has more strict validation (with libphonenumber-for-php) so things like area codes also need to be valid. Using numerify would definitely be a valid workaround if only a smaller subset of possible phone numbers is needed (also randomly selecting from multiple numerify inputs). Probably less expensive than some regexify stuff too. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions. |
I would still be interested in this. Only issue i could see is that this would require a full on reverse regex type of solution to generate phone numbers based on commonly used metadata (like googles libphonenumber). So it might be overkill for some use cases. My current workaround uses a reverse regex library with a static regex to generate plausible phone numbers for a country.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions. |
Summary
Similar issue : #332
Using e164PhoneNumber(), an invalid number is created for fr_FR. The generated phone numbers that start with 0 are invalid.
Ex : +330123456789
Versions
fakerphp/faker
Self-enclosed code snippet for reproduction
Expected output
number with +33[1-9]#########
Actual output
number with +33[0-9]#########
Source :
https://en.wikipedia.org/wiki/Telephone_numbers_in_France
The text was updated successfully, but these errors were encountered: