Skip to content

Commit af987d0

Browse files
committed
phpstan l12
1 parent 388f6e7 commit af987d0

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

.github/workflows/phpstan.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,22 @@ jobs:
1010
larastan:
1111
name: "Running Larastan check"
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
laravel: ["10.*", "11.*", "12.*"]
16+
include:
17+
- laravel: "10.*"
18+
phpstan: 1
19+
- laravel: "11.*"
20+
phpstan: 1
21+
- laravel: "12.*"
22+
phpstan: 2
23+
24+
name: L${{ matrix.laravel }} - PHPStan${{ matrix.phpstan }}
25+
1326
steps:
14-
- uses: actions/checkout@v3
27+
- name: Checkout code
28+
uses: actions/checkout@v3
1529

1630
- name: Setup PHP
1731
uses: shivammathur/setup-php@v2
@@ -27,7 +41,9 @@ jobs:
2741
key: composer-${{ hashFiles('composer.lock') }}
2842

2943
- name: Run composer install
30-
run: composer install -n --prefer-dist
44+
run: |
45+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
46+
composer update --prefer-dist --no-interaction
3147
3248
- name: Run phpstan
33-
run: ./vendor/bin/phpstan
49+
run: ./vendor/bin/phpstan --configuration=phpstan${{ matrix.phpstan }}.neon

phpstan1.neon

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
includes:
2+
- ./vendor/larastan/larastan/extension.neon
3+
4+
parameters:
5+
6+
paths:
7+
- src
8+
9+
level: max
10+
11+
ignoreErrors:
12+
- '#Parameter \#1 \$object_or_class of function method_exists expects object\|string, mixed given\.#'
13+
- '#Trying to invoke mixed but it(.*) not a callable\.#'
14+
15+
checkMissingIterableValueType: false
16+
17+
reportUnmatchedIgnoredErrors: false
18+
19+
checkOctaneCompatibility: true

phpstan2.neon

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
includes:
2+
- ./vendor/larastan/larastan/extension.neon
3+
4+
parameters:
5+
6+
paths:
7+
- src
8+
9+
level: max
10+
11+
ignoreErrors:
12+
- '#Parameter \#1 \$object_or_class of function method_exists expects object\|string, mixed given\.#'
13+
- '#Trying to invoke mixed but it(.*) not a callable\.#'
14+
- identifier: missingType.iterableValue
15+
16+
reportUnmatchedIgnoredErrors: false
17+
18+
checkOctaneCompatibility: true

0 commit comments

Comments
 (0)