davideme / libphonenumber-for-PHP

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

REGION_CODE_FOR_NON_GEO_ENTITY being removed from supportedRegions #30

Open MB34 opened 9 years ago

MB34 commented 9 years ago

I'm not sure if this package is still being supported because there haven't been any updates on issues since 2013. But...

In the init function, the call that removes the REGION_CODE_FOR_NON_GEO_ENTITY from the supportedRegions array removes US from the supportedRegions.

unset($this->supportedRegions[array_search(self::REGION_CODE_FOR_NON_GEO_ENTITY, $this->supportedRegions)]);

Why is this being done? It means that I cannot use this for US numbers.

I fixed it by replacing your init code with that by gissey's: https://github.com/giggsey/libphonenumber-for-php

But I'd really like to know why it was done this way and how to correctly use this package for US numbers.