Skip to content

Commit 571f45d

Browse files
authored
Laravel 12 upgrade (#136)
* laravel 12 upgrade * fixes * fixes * fix phpstan
1 parent 0a5a565 commit 571f45d

File tree

9 files changed

+24
-14
lines changed

9 files changed

+24
-14
lines changed

Diff for: .github/workflows/pest-coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup PHP
3030
uses: shivammathur/setup-php@v2
3131
with:
32-
php-version: 8.3
32+
php-version: 8.4
3333
coverage: xdebug
3434

3535
- name: Install dependencies

Diff for: .github/workflows/pest.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,22 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php: [ 8.3, 8.2, 8.1 ]
19-
laravel: [ 11.*, 10.* ]
18+
php: [ 8.4, 8.3, 8.2, 8.1 ]
19+
laravel: [ 12.*, 11.*, 10.* ]
2020
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' ]
2121
dependency-version: [ prefer-stable ]
2222
include:
2323
- laravel: 10.*
2424
testbench: ^8.0
2525
- laravel: 11.*
2626
testbench: ^9.0
27+
- laravel: 12.*
28+
testbench: ^10.0
2729
exclude:
2830
- laravel: 11.*
2931
php: 8.1
32+
- laravel: 12.*
33+
php: 8.1
3034

3135
services:
3236
db:

Diff for: .github/workflows/phpstan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php: [ 8.3, 8.2 ]
18+
php: [ 8.4, 8.3 ]
1919

2020
steps:
2121
- name: Checkout code

Diff for: .github/workflows/pint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: 8.3
22+
php-version: 8.4
2323
coverage: none
2424

2525
- name: Install dependencies

Diff for: composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
"php": "^8.1",
1414
"ext-json": "*",
1515
"ext-pdo": "*",
16-
"laravel/framework": "^10.0|^11.0",
16+
"laravel/framework": "^10.0|^11.0|^12.0",
1717
"phayes/geophp": "^1.2"
1818
},
1919
"require-dev": {
20-
"doctrine/dbal": "^3.5.3",
21-
"larastan/larastan": "^1.0|^2.4",
20+
"doctrine/dbal": "^3.5.3|^4.2",
21+
"larastan/larastan": "^1.0|^2.4|^3.1",
2222
"laravel/pint": "^1.14",
23-
"orchestra/testbench": "^8.0|^9.0",
24-
"pestphp/pest": "^2.0",
25-
"pestphp/pest-plugin-laravel": "^2.0"
23+
"orchestra/testbench": "^8.0|^9.0|^10.0",
24+
"pestphp/pest": "^2.0|^3.7",
25+
"pestphp/pest-plugin-laravel": "^2.0|^3.1"
2626
},
2727
"autoload": {
2828
"psr-4": {

Diff for: phpstan.neon

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ parameters:
2020
path: tests/*.php
2121
-
2222
identifier: missingType.generics
23+
-
24+
identifier: method.nonObject
25+
-
26+
identifier: varTag.nativeType
2327

2428
level: max
25-
checkMissingIterableValueType: true

Diff for: src/Enums/Srid.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
enum Srid: int
66
{
77
case WGS84 = 4326; // https://epsg.org/crs_4326/WGS-84.html
8-
case WEB_MERCATOR = 3857; //https://epsg.org/crs_3857/WGS-84-Pseudo-Mercator.html
8+
case WEB_MERCATOR = 3857; // https://epsg.org/crs_3857/WGS-84-Pseudo-Mercator.html
99
}

Diff for: src/Objects/Geometry.php

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function toWkb(): string
5959
// @phpstan-ignore-next-line
6060
$wkbWithoutSrid = (new geoPHPWkb)->write($geoPHPGeometry);
6161

62+
// @phpstan-ignore-next-line binaryOp.invalid
6263
return $sridInBinary.$wkbWithoutSrid;
6364
}
6465

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

7879
$geometry = Factory::parse($wkb);
80+
// @phpstan-ignore-next-line assign.propertyType
7981
$geometry->srid = $srid;
8082
}
8183

Diff for: src/Objects/GeometryCollection.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ protected function validateGeometriesCount(): void
155155
protected function validateGeometriesType(): void
156156
{
157157
$this->geometries->each(function (mixed $geometry): void {
158-
/** @var mixed $geometry */
158+
// @phpstan-ignore-next-line function.alreadyNarrowedType
159159
if (! is_object($geometry) || ! ($geometry instanceof $this->collectionOf)) {
160160
throw new InvalidArgumentException(
161161
sprintf('%s must be a collection of %s', static::class, $this->collectionOf)
@@ -169,6 +169,7 @@ protected function validateGeometriesType(): void
169169
*/
170170
private function isExtended(): bool
171171
{
172+
// @phpstan-ignore-next-line function.alreadyNarrowedType
172173
return is_subclass_of(static::class, self::class);
173174
}
174175
}

0 commit comments

Comments
 (0)