Skip to content

Commit

Permalink
Add PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Jul 15, 2023
1 parent cbb477a commit 2053bbc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
phpstan.neon.dist export-ignore
phpunit.xml.dist export-ignore
19 changes: 19 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Static Analysis

on: [ push, pull_request ]

jobs:
phpstan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/composer/files
key: php-8.2-composer-${{ hashFiles('**/composer.json') }}
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- run: composer update --no-interaction --no-progress --prefer-dist
- run: vendor/bin/phpstan analyse --error-format=github
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"illuminate/database": "^10.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0"
"phpunit/phpunit": "^10.0",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 0
paths:
- src
- tests

0 comments on commit 2053bbc

Please sign in to comment.