Skip to content

Commit 215e45b

Browse files
committed
chore: add phpstan
1 parent e5e9193 commit 215e45b

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

.github/workflows/build-ci.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,27 @@ jobs:
2727
coverage: none
2828
- name: Run PHP-CS-Fixer Fix, version ${{ env.PHP_CS_FIXER_VERSION }}
2929
run: php-cs-fixer fix --dry-run --diff --ansi
30-
30+
phpstan:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
php:
35+
- '8.1'
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v2
39+
- name: Setup PHP
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: ${{ matrix.php }}
43+
extensions: curl,mbstring
44+
tools: composer
45+
coverage: none
46+
ini-values: memory_limit=-1
47+
- name: Install dependencies
48+
run: composer install --no-interaction
49+
- name: Run PHPStan Analysis
50+
run: ./vendor/bin/phpstan analyse --no-interaction --no-progress --ansi
3151
build:
3252
runs-on: ${{ matrix.os }}
3353
name: PHP v${{ matrix.php }} with MongoDB ${{ matrix.mongodb }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.phpunit.result.cache
77
/.php-cs-fixer.php
88
/.php-cs-fixer.cache
9+
/phpstan.neon
910
/vendor
1011
composer.lock
1112
composer.phar

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"illuminate/container": "^9.0",
2424
"illuminate/database": "^9.0",
2525
"illuminate/events": "^9.0",
26-
"mongodb/mongodb": "^1.11"
26+
"mongodb/mongodb": "^1.11",
27+
"nunomaduro/larastan": "^2.2"
2728
},
2829
"require-dev": {
2930
"phpunit/phpunit": "^9.5.8",

phpstan.neon.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
includes:
2+
- ./vendor/nunomaduro/larastan/extension.neon
3+
parameters:
4+
paths:
5+
- src
6+
level: 5

0 commit comments

Comments
 (0)