geocoder-php / Geocoder

The most featured Geocoder library written in PHP.
https://geocoder-php.org
MIT License
3.94k stars 517 forks source link

Update IpInfoDb.php #1095

Closed rtiagom closed 1 year ago

rtiagom commented 3 years ago

Patch to prevent "Uncaught TypeError: Argument 11 passed to Geocoder\Model\Address".

rtiagom commented 3 years ago

I agree that this is not the best way to handle this issue but I don't have the time to work on a proper fix right now. At least the patch makes everything work with Geocoder\Model\Address.

rtiagom commented 3 years ago

Regarding the test IP, remember that the reason an Australian IP fails right now is because of daylight saving time and that changes in a few months which would make the test inconclusive.

I would recommend applying the current patch right now and open a ticket to find an alternative to timezone_name_from_abbr later on.

jbelien commented 3 years ago

At least the patch makes everything work with Geocoder\Model\Address.

I would recommend applying the current patch right now and open a ticket to find an alternative to timezone_name_from_abbr later on.

I don't really consider "hiding" the error to be a patch.

Regarding the test IP, remember that the reason an Australian IP fails right now is because of daylight saving time and that changes in a few months which would make the test inconclusive.

We store/cache the API response, the test will be the same at anytime.

rtiagom commented 3 years ago

I don't really consider "hiding" the error to be a patch.

Ok, fair enough. In our current project we have no use for the Address timezone field so it doesn't matter what it returns as long it doesn't break which this patch handles it. Feel free to reject the PR.