fix/distance parameter type for v2.x #44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses a type mismatch issue in the
scopeWithinDistanceTo
method and related methods in thelaravel-spatial
package. The$distance
parameter type has been updated fromint
tofloat
to better handle decimal distance values returned by theST_Distance
function. The changes ensure compatibility with spatial queries that rely on precise distance calculations.Parameter Type Update for Spatial Methods:
CHANGELOG.md
: Documented the fix for$distance
parameter type fromint
tofloat
inscopeWithinDistanceTo
and related methods.src/Traits/HasSpatial.php
: Updated the$distance
parameter type in thescopeWithinDistanceTo
method fromint
tofloat
.src/Traits/HasSpatial.php
: Updated the$distance
parameter type in thewithinDistanceToMysqlAndPostgres
private method fromint
tofloat
.src/Traits/HasSpatial.php
: Updated the$distance
parameter type in thewithinDistanceToMariaDb
private method fromint
tofloat
.