Skip to content

Commit 6460c89

Browse files
committed
added phpstan
1 parent a1c92ba commit 6460c89

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed

.github/workflows/phpstan.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
- '.github/workflows/phpstan.yml'
9+
10+
jobs:
11+
phpstan:
12+
name: phpstan
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.2'
22+
coverage: none
23+
24+
- name: Install composer dependencies
25+
uses: ramsey/composer-install@v2
26+
27+
- name: Run PHPStan
28+
run: ./vendor/bin/phpstan --error-format=github

composer.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"require": {
66
"php": "^8.2"
77
},
8+
"require-dev": {
9+
"laravel/pint": "^1.0",
10+
"phpstan/extension-installer": "^1.1",
11+
"phpstan/phpstan-deprecation-rules": "^1.0",
12+
"phpstan/phpstan-phpunit": "^1.0"
13+
},
814
"license": "MIT",
915
"autoload": {
1016
"psr-4": {
@@ -18,8 +24,15 @@
1824
"role": "Developer"
1925
}
2026
],
27+
"scripts": {
28+
"analyse": "vendor/bin/phpstan analyse",
29+
"format": "vendor/bin/pint"
30+
},
2131
"config": {
22-
"sort-packages": true
32+
"sort-packages": true,
33+
"allow-plugins": {
34+
"phpstan/extension-installer": true
35+
}
2336
},
2437
"minimum-stability": "dev",
2538
"prefer-stable": true

phpstan-baseline.neon

Whitespace-only changes.

phpstan.neon.dist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
4+
parameters:
5+
level: 5
6+
paths:
7+
- src
8+
tmpDir: build/phpstan
9+
checkMissingIterableValueType: false
10+

0 commit comments

Comments
 (0)