Skip to content
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

Improved formatting of telephone numbers according to the RFC3966 standard #224

Open
wants to merge 2 commits into
base: 2.0.0-dev
Choose a base branch
from

Conversation

tups
Copy link

@tups tups commented Feb 2, 2024

Hello,

I propose a significant improvement in the management of telephone numbers within your library. This enhancement aims to standardize phone number formatting based on the RFC3966 standard for phone number URIs. This will enable more consistent and standardized management of phone numbers, regardless of their original format.

Motivation :

The diversity of telephone number formats and the need to handle them in a uniform manner that complies with international standards underlines the importance of this update. Using the library brick/phonenumber, which is a wrapper around [giggsey/libphonenumber-for-php](https://github.com/giggsey/libphonenumber -for-php), we can ensure efficient and robust standardization of phone numbers.

Proposed changes:

  1. Updated composer.json to include brick/phonenumber as a dependency, ensuring that phone number manipulation is done with a dedicated and powerful tool.
  2. Modified TelephoneFormatter.php to use RFC3966-compliant URI format when outputting phone numbers.
  3. Added parsing and formatting logic to Telephone.php to transform incoming phone numbers into their standardized representation, and to support formatting according to the region defined on the server.

Benefits :

  • Conformity: All phone numbers will be formatted consistently.
  • Compliance with standards: The adoption of the RFC3966 standard improves compatibility and interoperability.
  • Flexibility: Formatting takes into account the region defined on the server, allowing automatic adaptation to local conventions.

I firmly believe that these changes will add significant value to your library by simplifying phone number management for end users. I look forward to your comments and am open to any discussion to refine this proposal.

Thanks for your consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant