Skip to content

Handling expression in location cast #41

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

Merged
merged 3 commits into from
May 14, 2025

Conversation

tkaratug
Copy link
Collaborator

This pull request introduces enhancements to the laravel-spatial package, focusing on adding expression support for the LocationCast class, modernizing the test suite with PHPUnit attributes, and improving test coverage. Below are the most significant changes grouped by theme:

Enhancements to LocationCast functionality:

  • Added support for handling Expression objects in the get() method of LocationCast by introducing a private getCoordinates() method. This allows parsing spatial expressions like ST_GeomFromText to extract coordinates. (src/Casts/LocationCast.php) [1] [2]

Modernization of the test suite:

  • Replaced @test annotations with #[Test] attributes across all test methods for compatibility with modern PHPUnit syntax. (tests/HasSpatialTest.php, tests/LocationCastTest.php, tests/PointTest.php) [1] [2] [3]

Improved test coverage:

  • Added a new test case to verify that the get() method in LocationCast correctly handles Expression objects and returns a Point instance. (tests/LocationCastTest.php)

Documentation updates:

  • Updated the CHANGELOG.md file to document the new features and changes introduced in version 3.0.1. (CHANGELOG.md)

@tkaratug tkaratug mentioned this pull request May 14, 2025
@tkaratug tkaratug merged commit 8151f3b into main May 14, 2025
24 checks passed
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

Successfully merging this pull request may close these issues.

2 participants