Skip to content

Commit 920e1f2

Browse files
aymanrbclaude
andcommitted
Add PHPStan level-8 static analysis with composer analyse and lint scripts
PHPStan at level 8 (the strictest) is added as a dev dependency with a phpstan.neon targeting the src/ directory. Two new composer scripts make common quality tasks discoverable without reading docs: `composer analyse` runs static analysis and `composer lint` checks PHP syntax across src/ and tests/. This catches type errors, dead code, and unsafe operations before they reach CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ef68658 commit 920e1f2

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
4747
},
4848
"require-dev": {
49-
"phpunit/phpunit": "^10.5"
49+
"phpunit/phpunit": "^10.5",
50+
"phpstan/phpstan": "^2.0"
5051
},
5152
"scripts": {
52-
"test": "phpunit --configuration phpunit.xml"
53+
"test": "phpunit --configuration phpunit.xml",
54+
"analyse": "phpstan analyse --configuration phpstan.neon",
55+
"lint": "find src tests -name '*.php' -print0 | xargs -0 php -l"
5356
}
5457
}

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 8
3+
paths:
4+
- src

0 commit comments

Comments
 (0)