Skip to content

Commit c7722d7

Browse files
committed
ci(deps-dev): Add strict rules for Larastan and update dependencies
- Added "canvural/larastan-strict-rules" version ^3.0 to require-dev - Added "larastan/larastan" version ^3.8 to require-dev - Ensures better type safety and code quality in the project
1 parent 6c8e2f1 commit c7722d7

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/phpstan.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,15 @@ jobs:
3737
- name: Run composer install
3838
run: composer install --no-interaction --ansi -v
3939

40+
- name: Run phpstan analyse error format sarif
41+
continue-on-error: true
42+
run: composer phpstan:analyse-error-format-sarif
43+
44+
- name: Upload analysis results to GitHub
45+
uses: github/codeql-action/upload-sarif@v2
46+
with:
47+
sarif_file: .build/phpstan/results.sarif
48+
wait-for-processing: true
49+
4050
- name: Run phpstan
4151
run: composer phpstan:analyse

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"guanguans/php-cs-fixer-custom-fixers": "^1.0",
7272
"guanguans/rector-rules": "^1.0",
7373
"itsgoingd/clockwork": "^5.3",
74+
"jbelien/phpstan-sarif-formatter": "^1.2",
7475
"laradumps/laradumps": "^4.6",
7576
"laravel/facade-documenter": "dev-main",
7677
"laravel/telescope": "^5.16",
@@ -385,6 +386,7 @@
385386
"phpmnd": "@php vendor/bin/phpmnd src/ --exclude-path=Support/helpers.phpp --ignore-numbers=2,-1 --hint --progress --ansi -vv",
386387
"phpstan": "@php vendor/bin/phpstan --ansi -vv",
387388
"phpstan:analyse": "@phpstan analyse",
389+
"phpstan:analyse-error-format-sarif": "@php vendor/bin/phpstan --ansi -vv analyse --error-format=sarif > .build/phpstan/results.sarif",
388390
"phpstan:analyse-generate-baseline": "@phpstan:analyse --generate-baseline --allow-empty-baseline",
389391
"phpstan:analyse-split-baseline": [
390392
"@phpstan:analyse --generate-baseline=baselines/loader.neon --allow-empty-baseline",

phpstan.neon.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ includes:
2727
# - vendor/symplify/phpstan-rules/config/rector-rules.neon
2828
# - vendor/symplify/phpstan-rules/config/symfony-rules.neon
2929

30+
services:
31+
errorFormatter.sarif:
32+
class: PHPStanSarifErrorFormatter\SarifErrorFormatter
33+
arguments:
34+
relativePathHelper: @simpleRelativePathHelper
35+
currentWorkingDirectory: %currentWorkingDirectory%
36+
pretty: true
37+
3038
parameters:
3139
paths:
3240
- config/

vendor-bin/php82/composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"require-dev": {
33
"php": ">=8.2",
4+
"canvural/larastan-strict-rules": "^3.0",
45
"ergebnis/composer-normalize": "^2.48",
56
"guanguans/monorepo-builder-worker": "^2.1",
7+
"larastan/larastan": "^3.8",
68
"mrpunyapal/rector-pest": "^0.1",
79
"peckphp/peck": "^0.2",
810
"phpro/grumphp-shim": "^2.18",

0 commit comments

Comments
 (0)