Skip to content

Laravel 12 upgrade #136

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 4 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pest-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 8.3, 8.2 ]
php: [ 8.4, 8.3 ]

steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Objects/GeometryCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
}