Skip to content

Commit

Permalink
added phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
rokde committed Feb 6, 2024
1 parent a1c92ba commit 6460c89
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'
- '.github/workflows/phpstan.yml'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
15 changes: 14 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"require": {
"php": "^8.2"
},
"require-dev": {
"laravel/pint": "^1.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0"
},
"license": "MIT",
"autoload": {
"psr-4": {
Expand All @@ -18,8 +24,15 @@
"role": "Developer"
}
],
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"format": "vendor/bin/pint"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
Empty file added phpstan-baseline.neon
Empty file.
10 changes: 10 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
includes:
- phpstan-baseline.neon

parameters:
level: 5
paths:
- src
tmpDir: build/phpstan
checkMissingIterableValueType: false

0 comments on commit 6460c89

Please sign in to comment.