Geocoder icon indicating copy to clipboard operation
Geocoder copied to clipboard

Improve functions signature

Open jbelien opened this issue 4 years ago • 5 comments

Now that we removed support for PHP 7.0, we can use nullable types.

I took the opportunity to improve functions signature.

jbelien avatar Jul 04 '20 10:07 jbelien

I would like to add float type to createCoordinates() parameters https://github.com/geocoder-php/Geocoder/blob/fce4473c2c7db8d455eb31176282c3eb5ae6ea30/src/Common/Model/Address.php#L279 but I noticed than type is not currently "forced" because some provider send string to that function and it's converted in Coordinates class: https://github.com/geocoder-php/Geocoder/blob/fce4473c2c7db8d455eb31176282c3eb5ae6ea30/src/Common/Model/Coordinates.php#L41-L42

What do you think about forcing the type and "fix" the providers than send string ?


Same question/"issue" for Bounds.

jbelien avatar Jul 04 '20 11:07 jbelien

Some of these are BC breaks. We dont plan to make a new major release, right?

We should only modify final classes.

Nyholm avatar Jul 04 '20 11:07 Nyholm

We dont plan to make a new major release, right?

That's the question indeed :P

jbelien avatar Jul 04 '20 11:07 jbelien

I dont think so.. there is no reason to break BC just because of dropping PHP 5. I mean, it should not be the only reason.

Nyholm avatar Jul 04 '20 11:07 Nyholm

Okay, I'll let this PR pending then ! 👌

I release a minor release for each provider following the last updated !

jbelien avatar Jul 04 '20 11:07 jbelien