Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MatanYadaev/laravel-eloquent-spatial
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.4.1
Choose a base ref
...
head repository: MatanYadaev/laravel-eloquent-spatial
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 3 commits
  • 10 files changed
  • 2 contributors

Commits on Nov 30, 2024

  1. Update CHANGELOG

    MatanYadaev authored and github-actions[bot] committed Nov 30, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0a5a565 View commit details

Commits on Feb 26, 2025

  1. Laravel 12 upgrade (#136)

    * laravel 12 upgrade
    
    * fixes
    
    * fixes
    
    * fix phpstan
    MatanYadaev authored Feb 26, 2025
    Copy the full SHA
    571f45d View commit details
  2. Update CHANGELOG

    MatanYadaev authored and github-actions[bot] committed Feb 26, 2025
    Copy the full SHA
    0457fe9 View commit details
2 changes: 1 addition & 1 deletion .github/workflows/pest-coverage.yml
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: xdebug

- name: Install dependencies
8 changes: 6 additions & 2 deletions .github/workflows/pest.yml
Original file line number Diff line number Diff line change
@@ -15,18 +15,22 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 8.3, 8.2, 8.1 ]
laravel: [ 11.*, 10.* ]
php: [ 8.4, 8.3, 8.2, 8.1 ]
laravel: [ 12.*, 11.*, 10.* ]
db: [ 'mysql:8.0', 'mysql:5.7', 'mariadb:10.11', 'postgis/postgis:16-3.4', 'postgis/postgis:15-3.4', 'postgis/postgis:14-3.4', 'postgis/postgis:13-3.4', 'postgis/postgis:12-3.4' ]
dependency-version: [ prefer-stable ]
include:
- laravel: 10.*
testbench: ^8.0
- laravel: 11.*
testbench: ^9.0
- laravel: 12.*
testbench: ^10.0
exclude:
- laravel: 11.*
php: 8.1
- laravel: 12.*
php: 8.1

services:
db:
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 8.3, 8.2 ]
php: [ 8.4, 8.3 ]

steps:
- name: Checkout code
2 changes: 1 addition & 1 deletion .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

- name: Install dependencies
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,26 @@

All notable changes to `laravel-eloquent-spatial` will be documented in this file.

## v4.5.0 - 2025-02-26

### What's Changed

* Laravel 12 upgrade by @MatanYadaev in https://github.com/MatanYadaev/laravel-eloquent-spatial/pull/136

**Full Changelog**: https://github.com/MatanYadaev/laravel-eloquent-spatial/compare/4.4.1...4.5.0

## v4.4.1 - 2024-11-30

### What's Changed

* Fix WKT for empty geometry collections by @LachlanArthur in https://github.com/MatanYadaev/laravel-eloquent-spatial/pull/132

### New Contributors

* @LachlanArthur made their first contribution in https://github.com/MatanYadaev/laravel-eloquent-spatial/pull/132

**Full Changelog**: https://github.com/MatanYadaev/laravel-eloquent-spatial/compare/4.4.0...4.4.1

## v4.4.0 - 2024-11-23

### What's Changed
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -13,16 +13,16 @@
"php": "^8.1",
"ext-json": "*",
"ext-pdo": "*",
"laravel/framework": "^10.0|^11.0",
"laravel/framework": "^10.0|^11.0|^12.0",
"phayes/geophp": "^1.2"
},
"require-dev": {
"doctrine/dbal": "^3.5.3",
"larastan/larastan": "^1.0|^2.4",
"doctrine/dbal": "^3.5.3|^4.2",
"larastan/larastan": "^1.0|^2.4|^3.1",
"laravel/pint": "^1.14",
"orchestra/testbench": "^8.0|^9.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0"
"orchestra/testbench": "^8.0|^9.0|^10.0",
"pestphp/pest": "^2.0|^3.7",
"pestphp/pest-plugin-laravel": "^2.0|^3.1"
},
"autoload": {
"psr-4": {
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@ parameters:
path: tests/*.php
-
identifier: missingType.generics
-
identifier: method.nonObject
-
identifier: varTag.nativeType

level: max
checkMissingIterableValueType: true
2 changes: 1 addition & 1 deletion src/Enums/Srid.php
Original file line number Diff line number Diff line change
@@ -5,5 +5,5 @@
enum Srid: int
{
case WGS84 = 4326; // https://epsg.org/crs_4326/WGS-84.html
case WEB_MERCATOR = 3857; //https://epsg.org/crs_3857/WGS-84-Pseudo-Mercator.html
case WEB_MERCATOR = 3857; // https://epsg.org/crs_3857/WGS-84-Pseudo-Mercator.html
}
2 changes: 2 additions & 0 deletions src/Objects/Geometry.php
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ public function toWkb(): string
// @phpstan-ignore-next-line
$wkbWithoutSrid = (new geoPHPWkb)->write($geoPHPGeometry);

// @phpstan-ignore-next-line binaryOp.invalid
return $sridInBinary.$wkbWithoutSrid;
}

@@ -76,6 +77,7 @@ public static function fromWkb(string $wkb): static
$wkb = substr($wkb, 4);

$geometry = Factory::parse($wkb);
// @phpstan-ignore-next-line assign.propertyType
$geometry->srid = $srid;
}

3 changes: 2 additions & 1 deletion src/Objects/GeometryCollection.php
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ protected function validateGeometriesCount(): void
protected function validateGeometriesType(): void
{
$this->geometries->each(function (mixed $geometry): void {
/** @var mixed $geometry */
// @phpstan-ignore-next-line function.alreadyNarrowedType
if (! is_object($geometry) || ! ($geometry instanceof $this->collectionOf)) {
throw new InvalidArgumentException(
sprintf('%s must be a collection of %s', static::class, $this->collectionOf)
@@ -169,6 +169,7 @@ protected function validateGeometriesType(): void
*/
private function isExtended(): bool
{
// @phpstan-ignore-next-line function.alreadyNarrowedType
return is_subclass_of(static::class, self::class);
}
}