diff --git a/.github/workflows/pest-coverage.yml b/.github/workflows/pest-coverage.yml index 33b1e14..9231b58 100644 --- a/.github/workflows/pest-coverage.yml +++ b/.github/workflows/pest-coverage.yml @@ -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 diff --git a/.github/workflows/pest.yml b/.github/workflows/pest.yml index 8cfc5e8..83339c7 100644 --- a/.github/workflows/pest.yml +++ b/.github/workflows/pest.yml @@ -15,8 +15,8 @@ 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: @@ -24,9 +24,13 @@ jobs: 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: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 4818f76..6141531 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ 8.3, 8.2 ] + php: [ 8.4, 8.3 ] steps: - name: Checkout code diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 964c054..9165b3c 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -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 diff --git a/composer.json b/composer.json index a521c35..23173ac 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/phpstan.neon b/phpstan.neon index a0d0397..41a557a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -20,6 +20,9 @@ parameters: path: tests/*.php - identifier: missingType.generics + - + identifier: method.nonObject + - + identifier: varTag.nativeType level: max - checkMissingIterableValueType: true diff --git a/src/Enums/Srid.php b/src/Enums/Srid.php index 682b5b1..24cc30c 100644 --- a/src/Enums/Srid.php +++ b/src/Enums/Srid.php @@ -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 } diff --git a/src/Objects/Geometry.php b/src/Objects/Geometry.php index 7cae616..7152271 100644 --- a/src/Objects/Geometry.php +++ b/src/Objects/Geometry.php @@ -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; } diff --git a/src/Objects/GeometryCollection.php b/src/Objects/GeometryCollection.php index 8908276..9a56ed5 100644 --- a/src/Objects/GeometryCollection.php +++ b/src/Objects/GeometryCollection.php @@ -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); } }