chore: install larastan at level 6 with accept-all baseline
Installs larastan/larastan ^3.0 (v3.9.6) as a dev-dependency. Level 6 is the starting target — catches missing typehints, method- existence, null-safety, and model-property existence. Level 8 deferred to a follow-up sprint after level-6 baseline reaches zero. Baseline error count at install: 1556 errors across 678 analysed files (41 distinct identifiers). Top 10 identifiers (errors / files): 613 / 87 property.notFound 289 / 52 missingType.generics 154 / 31 argument.templateType 98 / 61 missingType.iterableValue 77 / 32 argument.type 50 / 26 method.notFound 35 / 35 method.childReturnType 32 / 9 method.unresolvableReturnType 31 / 10 assign.propertyType 28 / 17 instanceof.alwaysTrue Composer scripts: - composer analyse — run static analysis - composer analyse:baseline — regenerate baseline - composer analyse:clear-cache — clear PHPStan result cache Config deviation from plan: checkGenericClassInNonGenericObjectType was removed in PHPStan 2.x (which Larastan 3 bundles) — setting dropped from phpstan.neon, otherwise config matches the work package verbatim. Defaults cover the original intent. Documentation: /dev-docs/LARASTAN.md added; CLAUDE.md quality-gates section introduced (with PHPUnit + Pint + Larastan listed). Backlog: /dev-docs/BACKLOG.md gets 10 per-identifier reduction sprints (TECH-LARASTAN-01..10) seeded from the actual baseline top categories, plus TECH-LARASTAN-CI and TECH-LARASTAN-L8 follow-ups. Memory limit 2G (baseline generation completed within it). No production behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
"larastan/larastan": "^3.0",
|
||||
"laravel/pail": "^1.2.2",
|
||||
"laravel/pint": "^1.24",
|
||||
"laravel/sail": "^1.41",
|
||||
@@ -55,6 +56,9 @@
|
||||
"@php artisan config:clear --ansi",
|
||||
"@php artisan test"
|
||||
],
|
||||
"analyse": "vendor/bin/phpstan analyse --memory-limit=2G",
|
||||
"analyse:baseline": "vendor/bin/phpstan analyse --generate-baseline --memory-limit=2G",
|
||||
"analyse:clear-cache": "vendor/bin/phpstan clear-result-cache",
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
|
||||
Reference in New Issue
Block a user