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

php 8.1.9 #180

Open
ahmedesa opened this issue Sep 6, 2022 · 3 comments
Open

php 8.1.9 #180

ahmedesa opened this issue Sep 6, 2022 · 3 comments

Comments

@ahmedesa
Copy link

ahmedesa commented Sep 6, 2022

problem with Coordinate

error : Deprecated: Implicit conversion from float -104.84929305556 to int loses precision

@FabrizioReitano
Copy link

I can also add:

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at /var/www/project/vendor/league/geotools/src/Geohash/Geohash.php:140

@Surfoo
Copy link
Collaborator

Surfoo commented Oct 26, 2022

Hello,

Thanks for your feedback!
Can you show a test case ?

@ASlatius
Copy link

Tested with php 8.2.13 raises the same issue. Any example will work
new \League\Geotools\Coordinate\Coordinate([2.307266, 48.823405]),
The first issue menthioned bij @ahmedesa most likely lies in this code;

public function normalizeLongitude($longitude)
{
    if (180 === $longitude % 360) {
        return 180.0;
    }

Looking at the code and modifying it to (int)$longitude should be safe and removes the depricated warning.

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

No branches or pull requests

4 participants