Skip to content

Commit 2c2b9c7

Browse files
authored
Add Phpstan workflow (#1001)
1 parent 40fbbe1 commit 2c2b9c7

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ CHANGELOG.md export-ignore
1010
CONTRIBUTING.md export-ignore
1111
phpunit.xml export-ignore
1212
README.md export-ignore
13+
phpstan* export-ignore

.github/workflows/phpstan.yml

+31
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.4
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 "larastan/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

+1
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.neon.dist

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
includes:
2+
- ./vendor/larastan/larastan/extension.neon
3+
4+
parameters:
5+
level: 8
6+
paths:
7+
- src/
8+
- config/
9+
- database/
10+
- stubs/
11+
tmpDir: build/phpstan
12+
ignoreErrors:
13+
-
14+
identifier: larastan.noEnvCallsOutsideOfConfig
15+
path: config/audit.php

0 commit comments

Comments
 (0)