Skip to content

Commit 8da6092

Browse files
committed
Set up PHPStan
1 parent 9e594c6 commit 8da6092

File tree

6 files changed

+483
-1
lines changed

6 files changed

+483
-1
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ tests/ export-ignore
77
.gitattributes export-ignore
88
.gitignore export-ignore
99
phpcs.xml.dist export-ignore
10+
phpstan.neon.dist export-ignore
1011
phpunit.xml.dist export-ignore

.github/workflows/phpstan.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
phpstan:
9+
runs-on: ubuntu-latest
10+
name: PHPStan
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- name: Setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: 8.4
18+
- name: Install Composer dependencies
19+
run: composer install --no-interaction --no-progress --no-scripts
20+
- name: Run PHPStan
21+
run: ./vendor/bin/phpstan --no-progress

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
vendor/
44
composer.lock
55
phpcs.xml
6+
phpstan.neon
67
phpunit.xml

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
"require-dev": {
2525
"guzzlehttp/guzzle": "^7.8",
2626
"orchestra/testbench": "^8.34 || ^9.12 || ^10.1",
27+
"phpstan/extension-installer": "^1.4",
28+
"phpstan/phpstan": "^2.1",
29+
"phpstan/phpstan-deprecation-rules": "^2.0",
30+
"phpstan/phpstan-strict-rules": "^2.0",
2731
"phpunit/phpunit": "^10.5 || ^11.5",
2832
"slevomat/coding-standard": "^8.16",
2933
"symfony/var-exporter": "^6.4 || ^7.0"
@@ -40,7 +44,8 @@
4044
},
4145
"config": {
4246
"allow-plugins": {
43-
"dealerdirect/phpcodesniffer-composer-installer": true
47+
"dealerdirect/phpcodesniffer-composer-installer": true,
48+
"phpstan/extension-installer": true
4449
},
4550
"sort-packages": true
4651
},

0 commit comments

Comments
 (0)