davideme / libphonenumber-for-PHP

PHP version of Google's phone number handling library
125 stars 71 forks source link

I have add fixes for isset issues (Fixes problem with parsing US number, fixes isValidNumber fails on Windows) #6

Open resscode opened 11 years ago

resscode commented 11 years ago

There are the next fixes:

  1. Fixes problem with parsing US number succeeds in tests fails in actual usage
  2. Fixes isValidNumber fails on Windows
  3. There were some problems with validation rules for validation rules of Ecuador and Guadeloupe, I have add fix for it

Please, check it and thanks for a good port of phonelib.

Nephele commented 11 years ago

I've been trying to assemble a working version of libphonenumber-for-PHP and wanted to incorporate your patches. However, after looking more closely at your patches, I had a couple questions:

  1. Shouldn't the isValidNumber code change be applied to all platforms, instead of just Windows? The EOL character could have been changed in the files regardless of the platform where the code is running, so it seems safest to explicitly remove \r and \n in all cases.
  2. Do you have any documentation for the validation rule changes for Ecuador and Guadeloupe? As I understand it, the source for all the metadata is google's original metadata file, at https://code.google.com/p/libphonenumber/source/browse/trunk/resources/PhoneNumberMetaData.xml. That metadata is being regularly maintained, so I'd expect its information to be accurate. However, none of your changes match what's in that metadata file. Also, all of the PhoneNumberMetadata* files should periodically be automatically regenerated from the original xml file, at which point any hard-coded changes to those files will disappear. Thanks!