Skip to content

Commit bea5127

Browse files
committed
Add PHPStan
1 parent 03e8843 commit bea5127

File tree

4 files changed

+313
-6
lines changed

4 files changed

+313
-6
lines changed

.github/workflows/lint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
14+
cancel-in-progress: true
15+
16+
permissions: {}
17+
18+
jobs:
19+
phpstan:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v5
23+
24+
- uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: '8.4'
27+
coverage: none
28+
- uses: ramsey/composer-install@v3
29+
30+
- run: vendor/bin/phpstan analyse --error-format=github

composer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434
},
3535
"require-dev": {
3636
"mockery/mockery": "^1.6.12",
37-
"pestphp/pest": "^4.1.2"
37+
"pestphp/pest": "^4.1.2",
38+
"phpstan/extension-installer": "^1.4",
39+
"phpstan/phpstan": "^2.1",
40+
"phpstan/phpstan-deprecation-rules": "^2.0",
41+
"phpstan/phpstan-strict-rules": "^2.0",
42+
"phpstan/phpstan-symfony": "^2.0"
3843
},
3944
"autoload": {
4045
"psr-4": {
@@ -51,7 +56,8 @@
5156
],
5257
"config": {
5358
"allow-plugins": {
54-
"pestphp/pest-plugin": true
59+
"pestphp/pest-plugin": true,
60+
"phpstan/extension-installer": true
5561
},
5662
"sort-packages": true
5763
},
@@ -67,10 +73,9 @@
6773
"pest:e2e": "XDEBUG_MODE=off pest --group=e2e",
6874
"pest:feature": "pest --group=feature",
6975
"pest:unit": "pest --group=unit",
70-
"test": [
71-
"@composer normalize --dry-run",
76+
"lint": [
7277
"pint --test",
73-
"XDEBUG_MODE=off pest"
78+
"phpstan analyse"
7479
]
7580
}
7681
}

composer.lock

Lines changed: 268 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: max
3+
paths:
4+
- bin
5+
- src

0 commit comments

Comments
 (0)