laminas / laminas-i18n

Provide translations for your application, and filter and validate internationalized values
https://docs.laminas.dev/laminas-i18n/
BSD 3-Clause "New" or "Revised" License
50 stars 29 forks source link

[RFC]: Use external dependency to validate and format international phone numbers #74

Closed gsteel closed 2 years ago

gsteel commented 2 years ago

RFC

Q A
Proposed Version(s) current
BC Break? hopefully not

Background

The phone number validator must take a lot of maintenance to keep up with global changes to area codes and number formats etc.

I've used giggsey/libphonenumber-for-php on a number of projects and found it to be well maintained and frequently updated with new information from Google's libphonenumber project.

Proposal(s)

Potential BC Breaks

There may not be a 1-1 mapping between the existing possible number types and those found in https://github.com/giggsey/libphonenumber-for-php/blob/master/src/PhoneNumberType.php

Appendix

Relevant to issues #73 and #3

Ocramius commented 2 years ago

IMO not to be dragged into laminas/laminas-i18n, but into something like laminas/laminas-i18n-phone-number, which would then be an adapter with the declared external dependency.

gsteel commented 2 years ago

@Ocramius - would you expect to drop the validator here in a future major of i18n? I've probably got most of what would be needed here in other projects…

Ocramius commented 2 years ago

would you expect to drop the validator here in a future major of i18n?

Something like that, with a smooth migration path (find/replace-only, perhaps)

gsteel commented 2 years ago

@Ocramius - Here's an initial stab at laminas-i18n-phone-number https://github.com/gsteel/laminas-i18n-phone-number

Ocramius commented 2 years ago

@gsteel IMO bring it up with next TSC agenda?

gsteel commented 2 years ago

Also relevant to #77 - Closing this now pending introduction of the new lib at https://github.com/laminas/laminas-i18n-phone-number