Skip to content

Commit e51c174

Browse files
committed
Add PHPStan static analysis
1 parent 49a2c67 commit e51c174

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

.github/workflows/phpstan.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Static Analysis
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
pull_request:
7+
8+
jobs:
9+
phpstan:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: '8.3'
17+
- name: Install dependencies
18+
run: composer install --no-interaction --no-progress
19+
- name: Run PHPStan
20+
run: vendor/bin/phpstan analyse src tests

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
"ext-json": "*"
2828
},
2929
"require-dev": {
30-
"phpunit/phpunit": "^9.3|^10.5",
31-
"mockery/mockery": "^1.0",
3230
"laravel/pint": "^1.0",
33-
"orchestra/testbench": "^v4.18.0|^v5.20.0|^v6.25.0|^8.0|^9.0|^10.0"
31+
"mockery/mockery": "^1.0",
32+
"orchestra/testbench": "^v4.18.0|^v5.20.0|^v6.25.0|^8.0|^9.0|^10.0",
33+
"phpstan/phpstan": "^1.0",
34+
"phpunit/phpunit": "^9.3|^10.5"
3435
},
3536
"autoload": {
3637
"psr-4": {

phpstan.neon

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

0 commit comments

Comments
 (0)