Skip to content

Commit 04fd935

Browse files
committed
Add Phpstan workflow
1 parent a241d88 commit 04fd935

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ CHANGELOG.md export-ignore
99
CONTRIBUTING.md export-ignore
1010
phpunit.xml export-ignore
1111
README.md export-ignore
12+
phpstan* export-ignore

.github/workflows/phpstan.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
9+
jobs:
10+
phpstan:
11+
name: phpstan
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: 8.3
20+
coverage: none
21+
22+
- name: Install composer dependencies
23+
uses: ramsey/composer-install@v3
24+
25+
- name: Install larastan
26+
run: |
27+
composer require "nunomaduro/larastan" --no-interaction --no-update
28+
composer update --prefer-dist --no-interaction
29+
30+
- name: Run PHPStan
31+
run: ./vendor/bin/phpstan --error-format=github

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ composer.lock
44
.vscode
55
.phpunit.cache
66
.phpunit.result.cache
7+
/build/phpstan

phpstan-baseline.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
ignoreErrors:

phpstan.neon.dist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
- ./vendor/nunomaduro/larastan/extension.neon
4+
5+
parameters:
6+
level: 8
7+
paths:
8+
- src/
9+
- config/
10+
- database/migrations/audits.stub
11+
- stubs/
12+
tmpDir: build/phpstan
13+
checkOctaneCompatibility: false
14+
treatPhpDocTypesAsCertain: false
15+
16+
ignoreErrors:
17+
-
18+
identifier: larastan.noEnvCallsOutsideOfConfig
19+
path: config/audit.php

0 commit comments

Comments
 (0)