labrodev-static-analysislisted
Install: claude install-skill labrodev/laravel-playbook
# Static Analysis: Pint, PHPStan, Rector
Part of the Labrodev playbook. **The law for this component lives in the always-on `labrodev-static-analysis` guideline** (musts, must-nots); the per-file checklist is `rules/static-analysis.md`. This skill holds the craft: configs, run order, and troubleshooting.
## Commands
```bash
vendor/bin/rector process app/ src/ # automated refactoring (review the diff!)
vendor/bin/pint # code style — config is canonical
vendor/bin/phpstan analyse --memory-limit=2G # static analysis (Larastan) — must pass
```
When the local PHP version differs from the project's required version, run the tools through the project runtime (Sail): `vendor/bin/sail bin phpstan analyse --memory-limit=2G` — never against a mismatched local PHP.
Composer scripts (recommended, so every agent and CI runs the same thing):
```json
"scripts": {
"refactor": "rector process",
"lint": "pint",
"analyse": "phpstan analyse --memory-limit=1G",
"check": [
"@refactor",
"@lint",
"@analyse"
]
}
```
## Pint
Pint enforces formatting, imports, spacing, and modern PHP conventions. The `laravel` preset is the base; add the rules that mechanically enforce the playbook's file-header contract instead of relying on discipline:
```json
{
"preset": "laravel",
"notPath": [
"_ide_helper_models.php"
],
"rules": {
"declare_strict_types": true,
"final_class": true,
"