From 9ef65a16e4a5f1587fd5d15f790169a86182671e Mon Sep 17 00:00:00 2001 From: Tom Janssen Date: Thu, 28 Nov 2024 12:18:06 +0100 Subject: [PATCH] change workflow --- .github/workflows/phpstan.yml | 10 +++++++--- phpstan-baseline.laravel-10.neon | 31 +++++++++++++++++++++++++++++++ phpstan.laravel-10.neon.dist | 12 ++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 phpstan-baseline.laravel-10.neon create mode 100644 phpstan.laravel-10.neon.dist diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 70dfe55..d300787 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -6,7 +6,10 @@ on: - '**.php' - '.github/workflows/phpstan.yml' - 'phpstan.neon.dist' + - 'phpstan.laravel-10.neon.dist' pull_request: + branches: + - '**' jobs: phpstan: @@ -15,14 +18,16 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.3, 8.2, 8.1] + php: [8.4, 8.3, 8.2, 8.1] laravel: [10.*, 11.*] stability: [prefer-stable] include: - laravel: 10.* testbench: 8.* + phpstan_neon: phpstan.laravel-10.neon.dist - laravel: 11.* testbench: 9.* + phpstan_neon: phpstan.neon.dist exclude: - laravel: 11.* php: 8.1 @@ -44,9 +49,8 @@ jobs: run: | composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - - name: List Installed Dependencies run: composer show -D - name: Run PHPStan - run: vendor/bin/phpstan --error-format=github + run: vendor/bin/phpstan --error-format=github --configuration=${{ matrix.phpstan_neon }} diff --git a/phpstan-baseline.laravel-10.neon b/phpstan-baseline.laravel-10.neon new file mode 100644 index 0000000..4d514a6 --- /dev/null +++ b/phpstan-baseline.laravel-10.neon @@ -0,0 +1,31 @@ +parameters: + ignoreErrors: + - + message: "#^Class App\\\\Models\\\\User not found\\.$#" + count: 1 + path: src/FilamentSocialitePlugin.php + + - + message: "#^Property DutchCodingCompany\\\\FilamentSocialite\\\\FilamentSocialitePlugin\\:\\:\\$userModelClass \\(class\\-string\\\\) does not accept default value of type string\\.$#" + count: 1 + path: src/FilamentSocialitePlugin.php + + - + message: "#^Parameter \\#1 \\$value of method DutchCodingCompany\\\\FilamentSocialite\\\\Http\\\\Controllers\\\\SocialiteLoginController\\:\\:evaluate\\(\\) expects bool\\|\\(callable\\(\\)\\: bool\\), bool\\|\\(Closure\\(string, Laravel\\\\Socialite\\\\Contracts\\\\User, Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable\\|null\\)\\: bool\\) given\\.$#" + count: 1 + path: src/Http/Controllers/SocialiteLoginController.php + + - + message: "#^Method DutchCodingCompany\\\\FilamentSocialite\\\\Tests\\\\Fixtures\\\\TestTenantUser\\:\\:teams\\(\\) should return Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsToMany\\ but returns Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsToMany\\\\.$#" + count: 1 + path: tests/Fixtures/TestTenantUser.php + + - + message: "#^Call to an undefined method Mockery\\\\ExpectationInterface\\|Mockery\\\\HigherOrderMessage\\:\\:andReturn\\(\\)\\.$#" + count: 3 + path: tests/TestCase.php + + - + message: "#^Parameter \\#1 \\$callback of static method Illuminate\\\\Database\\\\Eloquent\\\\Factories\\\\Factory\\\\:\\:guessFactoryNamesUsing\\(\\) expects callable\\(class\\-string\\\\)\\: class\\-string\\, Closure\\(string\\)\\: non\\-falsy\\-string given\\.$#" + count: 1 + path: tests/TestCase.php diff --git a/phpstan.laravel-10.neon.dist b/phpstan.laravel-10.neon.dist new file mode 100644 index 0000000..9ef2981 --- /dev/null +++ b/phpstan.laravel-10.neon.dist @@ -0,0 +1,12 @@ +includes: + - ./vendor/larastan/larastan/extension.neon + - ./phpstan-baseline.laravel-10.neon + +parameters: + level: 8 + + paths: + - config + - database + - src + - tests