Skip to content

Commit

Permalink
Add Phpstan workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 committed Jan 24, 2025
1 parent a241d88 commit 3d73436
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CHANGELOG.md export-ignore
CONTRIBUTING.md export-ignore
phpunit.xml export-ignore
README.md export-ignore
phpstan* export-ignore
31 changes: 31 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

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

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

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

- name: Install larastan
run: |
composer require "nunomaduro/larastan" --no-interaction --no-update
composer update --prefer-dist --no-interaction
- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ composer.lock
.vscode
.phpunit.cache
.phpunit.result.cache
/build/phpstan
2 changes: 2 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors:
16 changes: 16 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
includes:
- phpstan-baseline.neon
- ./vendor/nunomaduro/larastan/extension.neon

parameters:
level: 8
paths:
- src/
- config/
- database/migrations/audits.stub
- stubs/
tmpDir: build/phpstan
ignoreErrors:
-
identifier: larastan.noEnvCallsOutsideOfConfig
path: config/audit.php

0 comments on commit 3d73436

Please sign in to comment.