From 8b89a4f23322be4b5005aae11152a740c7e23c6c Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:14:26 -0500 Subject: [PATCH 01/11] Abanonded larastan repository. Switched to actively maintained repo. --- composer.json | 2 +- composer.lock | 189 +++++++++++++++++++++++++------------------------- 2 files changed, 95 insertions(+), 96 deletions(-) diff --git a/composer.json b/composer.json index 0d89e5d..090acb9 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "require-dev": { "laravel/pint": "^1.5", "nunomaduro/collision": "^6.4", - "nunomaduro/larastan": "^2.4.1", + "larastan/larastan": "^2.4.1", "orchestra/testbench": "^7.22", "pestphp/pest": "^1.22", "pestphp/pest-plugin-laravel": "^1.1", diff --git a/composer.lock b/composer.lock index c821620..fe045ba 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fdeb48ede1748f898825a4a057aac1fc", + "content-hash": "ebb7367174dd56b3d387e77709193917", "packages": [ { "name": "brick/math", @@ -5372,6 +5372,99 @@ }, "time": "2024-11-18T16:19:46+00:00" }, + { + "name": "larastan/larastan", + "version": "v2.9.14", + "source": { + "type": "git", + "url": "https://github.com/larastan/larastan.git", + "reference": "78f7f8da613e54edb2ab4afa5bede045228fb843" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/larastan/larastan/zipball/78f7f8da613e54edb2ab4afa5bede045228fb843", + "reference": "78f7f8da613e54edb2ab4afa5bede045228fb843", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/console": "^9.52.16 || ^10.28.0 || ^11.16", + "illuminate/container": "^9.52.16 || ^10.28.0 || ^11.16", + "illuminate/contracts": "^9.52.16 || ^10.28.0 || ^11.16", + "illuminate/database": "^9.52.16 || ^10.28.0 || ^11.16", + "illuminate/http": "^9.52.16 || ^10.28.0 || ^11.16", + "illuminate/pipeline": "^9.52.16 || ^10.28.0 || ^11.16", + "illuminate/support": "^9.52.16 || ^10.28.0 || ^11.16", + "php": "^8.0.2", + "phpmyadmin/sql-parser": "^5.9.0", + "phpstan/phpstan": "^1.12.17" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0", + "laravel/framework": "^9.52.16 || ^10.28.0 || ^11.16", + "mockery/mockery": "^1.5.1", + "nikic/php-parser": "^4.19.1", + "orchestra/canvas": "^7.11.1 || ^8.11.0 || ^9.0.2", + "orchestra/testbench-core": "^7.33.0 || ^8.13.0 || ^9.0.9", + "phpstan/phpstan-deprecation-rules": "^1.2", + "phpunit/phpunit": "^9.6.13 || ^10.5.16" + }, + "suggest": { + "orchestra/testbench": "Using Larastan for analysing a package needs Testbench" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Larastan\\Larastan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Can Vural", + "email": "can9119@gmail.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "larastan", + "laravel", + "package", + "php", + "static analysis" + ], + "support": { + "issues": "https://github.com/larastan/larastan/issues", + "source": "https://github.com/larastan/larastan/tree/v2.9.14" + }, + "funding": [ + { + "url": "https://github.com/canvural", + "type": "github" + } + ], + "time": "2025-02-06T21:03:14+00:00" + }, { "name": "laravel/pint", "version": "v1.21.0", @@ -5793,100 +5886,6 @@ ], "time": "2023-01-03T12:54:54+00:00" }, - { - "name": "nunomaduro/larastan", - "version": "v2.9.14", - "source": { - "type": "git", - "url": "https://github.com/larastan/larastan.git", - "reference": "78f7f8da613e54edb2ab4afa5bede045228fb843" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/78f7f8da613e54edb2ab4afa5bede045228fb843", - "reference": "78f7f8da613e54edb2ab4afa5bede045228fb843", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/console": "^9.52.16 || ^10.28.0 || ^11.16", - "illuminate/container": "^9.52.16 || ^10.28.0 || ^11.16", - "illuminate/contracts": "^9.52.16 || ^10.28.0 || ^11.16", - "illuminate/database": "^9.52.16 || ^10.28.0 || ^11.16", - "illuminate/http": "^9.52.16 || ^10.28.0 || ^11.16", - "illuminate/pipeline": "^9.52.16 || ^10.28.0 || ^11.16", - "illuminate/support": "^9.52.16 || ^10.28.0 || ^11.16", - "php": "^8.0.2", - "phpmyadmin/sql-parser": "^5.9.0", - "phpstan/phpstan": "^1.12.17" - }, - "require-dev": { - "doctrine/coding-standard": "^12.0", - "laravel/framework": "^9.52.16 || ^10.28.0 || ^11.16", - "mockery/mockery": "^1.5.1", - "nikic/php-parser": "^4.19.1", - "orchestra/canvas": "^7.11.1 || ^8.11.0 || ^9.0.2", - "orchestra/testbench-core": "^7.33.0 || ^8.13.0 || ^9.0.9", - "phpstan/phpstan-deprecation-rules": "^1.2", - "phpunit/phpunit": "^9.6.13 || ^10.5.16" - }, - "suggest": { - "orchestra/testbench": "Using Larastan for analysing a package needs Testbench" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] - }, - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Larastan\\Larastan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Can Vural", - "email": "can9119@gmail.com" - }, - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel", - "keywords": [ - "PHPStan", - "code analyse", - "code analysis", - "larastan", - "laravel", - "package", - "php", - "static analysis" - ], - "support": { - "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.9.14" - }, - "funding": [ - { - "url": "https://github.com/canvural", - "type": "github" - } - ], - "abandoned": "larastan/larastan", - "time": "2025-02-06T21:03:14+00:00" - }, { "name": "orchestra/canvas", "version": "v7.12.0", From ca9f5877a4c81468daae2a22a36270ebae29cd5d Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:18:35 -0500 Subject: [PATCH 02/11] Add Laravel 11 & 12, and PHP 8.3 and 8.4 to the testing matrix --- .github/workflows/run-tests.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5d9546a..1184b88 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,10 +13,16 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest, windows-latest ] - php: [ 8.2, 8.1 ] - laravel: [ 10.*, 9.* ] + php: [ 8.4, 8.3, 8.2, 8.1 ] + laravel: [ 12.*, 11.*, 10.*, 9.* ] stability: [ prefer-lowest, prefer-stable ] include: + - laravel: 12.* + testbench: 8.* + carbon: ^2.63 + - laravel: 11.* + testbench: 8.* + carbon: ^2.63 - laravel: 10.* testbench: 8.* carbon: ^2.63 From 0a7387199a2dc7bc2b3841ab47d7418a7254df81 Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:18:35 -0500 Subject: [PATCH 03/11] Add Laravel 11 & 12, and PHP 8.3 and 8.4 to the testing matrix --- .github/workflows/run-tests.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5d9546a..d97559e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,10 +13,18 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest, windows-latest ] - php: [ 8.2, 8.1 ] - laravel: [ 10.*, 9.* ] + php: [ 8.4, 8.3, 8.2, 8.1 ] + laravel: [ 12.*, 11.*, 10.*, 9.* ] stability: [ prefer-lowest, prefer-stable ] include: + - laravel: 12.* + testbench: 8.* + carbon: ^3.84 + php: 8.2 + - laravel: 11.* + testbench: 8.* + carbon: ^2.63 + php: 8.2 - laravel: 10.* testbench: 8.* carbon: ^2.63 From aebdfb8d31b7451870ec3981240ee5842ac6d1d2 Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:34:11 -0500 Subject: [PATCH 04/11] Use testbench 10 on Laravel 12, and 9 on Laravel 11 --- .github/workflows/run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d97559e..aee76d7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,11 +18,11 @@ jobs: stability: [ prefer-lowest, prefer-stable ] include: - laravel: 12.* - testbench: 8.* + testbench: 10.* carbon: ^3.84 php: 8.2 - laravel: 11.* - testbench: 8.* + testbench: 9.* carbon: ^2.63 php: 8.2 - laravel: 10.* From d1b16cda0cc23a77b05ec30df6d679f44d2ca90d Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:39:27 -0500 Subject: [PATCH 05/11] WIP: Matrix updates --- .github/workflows/run-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index aee76d7..ee4aade 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -28,9 +28,11 @@ jobs: - laravel: 10.* testbench: 8.* carbon: ^2.63 + php: 8.2 - laravel: 9.* testbench: ^7.0 carbon: ^2.63 + php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From 16796aa414635930f2e454c4928c5e29328dcdfc Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:47:23 -0500 Subject: [PATCH 06/11] WIP: Matrix updates --- .github/workflows/run-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ee4aade..cef49f1 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,6 +15,8 @@ jobs: os: [ ubuntu-latest, windows-latest ] php: [ 8.4, 8.3, 8.2, 8.1 ] laravel: [ 12.*, 11.*, 10.*, 9.* ] + testbench: [ 10.*, 9.*, 8.*, ^7.0 ] + carbon: [ ^3.84, ^2.63 ] stability: [ prefer-lowest, prefer-stable ] include: - laravel: 12.* From 5e1ad2fc6310eaef7030e13e1df08331d6adae9d Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:52:11 -0500 Subject: [PATCH 07/11] WIP: Matrix updates --- .github/workflows/run-tests.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index cef49f1..fd35d34 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,19 +14,9 @@ jobs: matrix: os: [ ubuntu-latest, windows-latest ] php: [ 8.4, 8.3, 8.2, 8.1 ] - laravel: [ 12.*, 11.*, 10.*, 9.* ] - testbench: [ 10.*, 9.*, 8.*, ^7.0 ] - carbon: [ ^3.84, ^2.63 ] + laravel: [ 10.*, 9.* ] stability: [ prefer-lowest, prefer-stable ] include: - - laravel: 12.* - testbench: 10.* - carbon: ^3.84 - php: 8.2 - - laravel: 11.* - testbench: 9.* - carbon: ^2.63 - php: 8.2 - laravel: 10.* testbench: 8.* carbon: ^2.63 From 21b4edf24362467f1cbe3259adfda93520178599 Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:56:50 -0500 Subject: [PATCH 08/11] WIP: Matrix updates --- .github/workflows/run-tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index fd35d34..5d9546a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,18 +13,16 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest, windows-latest ] - php: [ 8.4, 8.3, 8.2, 8.1 ] + php: [ 8.2, 8.1 ] laravel: [ 10.*, 9.* ] stability: [ prefer-lowest, prefer-stable ] include: - laravel: 10.* testbench: 8.* carbon: ^2.63 - php: 8.2 - laravel: 9.* testbench: ^7.0 carbon: ^2.63 - php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From 8643686d24741180585548814db03139b74aee4a Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 21:58:24 -0500 Subject: [PATCH 09/11] Add PHP 8.3 and PHP 8.4 Support --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5d9546a..6596663 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest, windows-latest ] - php: [ 8.2, 8.1 ] + php: [ 8.4, 8.3, 8.2, 8.1 ] laravel: [ 10.*, 9.* ] stability: [ prefer-lowest, prefer-stable ] include: From cd7c908a8bf9438be972a1e05e7f830368446784 Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 22:06:42 -0500 Subject: [PATCH 10/11] Exception type changes in php 8.3 --- tests/Unit/Api/ModelTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/Api/ModelTest.php b/tests/Unit/Api/ModelTest.php index 94de41f..76b5435 100644 --- a/tests/Unit/Api/ModelTest.php +++ b/tests/Unit/Api/ModelTest.php @@ -386,7 +386,7 @@ public function scopeTestScope(...$parameters) }; $castMethod = new ReflectionMethod($model, 'cast'); $castMethod->invoke($model, 'abc', 'datetime'); -})->throws(InvalidFormatException::class); +})->throws(Exception::class); test('cast to string throws exception on array', function () { $model = new class extends AbstractApiModel { From e71ba51430ba51ea1883ab096846954bf593c596 Mon Sep 17 00:00:00 2001 From: Shawn Hooper Date: Wed, 5 Mar 2025 22:10:54 -0500 Subject: [PATCH 11/11] Add Laravel 11 Support --- .github/workflows/run-tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 6596663..99f00d6 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,9 +14,12 @@ jobs: matrix: os: [ ubuntu-latest, windows-latest ] php: [ 8.4, 8.3, 8.2, 8.1 ] - laravel: [ 10.*, 9.* ] + laravel: [ 11.*, 10.*, 9.* ] stability: [ prefer-lowest, prefer-stable ] include: + - laravel: 11.* + testbench: 9.* + carbon: ^3.84 - laravel: 10.* testbench: 8.* carbon: ^2.63