I am receiving the error "TypeError: Argument 1 passed to Drupal\geocoder\Geocoder::reverse() must be an instance of double, float given, called in " and believe it has something to do with #2831732: Code Standards. Just wondering why double was chosen and not float?

Comments

Gravypower created an issue. See original summary.

Gravypower’s picture

Added in patch that changes the type to float so I can patch this module in my build.

Gravypower’s picture

So this may only be an issue with PHP 7, looking into this more now.

Gravypower’s picture

So this was an issue when using PHP 7

yoran scholiers’s picture

Had the same issue when trying to implement the Reverse method.
Also using PHP7. The patch above allows me to continue.

ahebrank’s picture

It may be better to remove the type hints entirely since the underlying dependency doesn't have them: https://github.com/geocoder-php/Geocoder/blob/master/src/Geocoder.php#L42

itamair’s picture

Priority: Normal » Critical

This patch seems to be essential to implement reverse geocoding in PHP 7,
thus (IMHO) should be committed ASAP and a new version of Geocoder released with it

  • Pol committed 138c550 on 8.x-2.x authored by ahebrank
    Issue #2847892 by Gravypower, ahebrank: TypeError: Argument 1 passed to...
pol’s picture

Status: Active » Fixed

Thanks, it's fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.