ticketswap/phpstan-error-formatter
Minimalistic PHPStan error formatter with per-error clickable file/line links, non-wrapping output, naive syntax highlighting, and visually truncated long paths while preserving links. Easy install via Composer; set PHPStan errorFormat to ticketswap.
errorFormat: ticketswap). Leverages PHPStan’s extension system (via extension.neon), ensuring compatibility with existing workflows.file:// URLs) for IDEs like PhpStorm, ensuring universal usability.composer require --dev ticketswap/phpstan-error-formatter and configure in phpstan.neon.phpstan/extension-installer, reducing manual setup.parameters:
errorFormat: ticketswap
editorUrl: 'vscode://file/%%file%%:%%line%%' # IDE-specific
src/App/../Entity/User.php) preserves clickable links, but edge cases (e.g., network paths, symlinks) may need testing.Developer Tooling Stack:
PHPStan Adoption:
CI/CD Pipeline:
grep, custom scripts, or tools like phpstan/parser?)Codebase Characteristics:
@param docblocks for native types (e.g., string, int) that this formatter could auto-remove?Maintenance Commitment:
editorUrl for new IDEs)?level: 8, level: max).phpstan/rule-set).phpstan --parallel).| Step | Action | Risk | Mitigation |
|---|---|---|---|
| 1 | Install Package | Low | composer require --dev ticketswap/phpstan-error-formatter |
| 2 | Configure PHPStan | Low | Update phpstan.neon with errorFormat: ticketswap |
| 3 | Set editorUrl |
Medium | Test with vscode:// or phpstorm://; fall back to file:// |
| 4 | Validate Output | Low | Run phpstan analyse and verify clickable links and highlighting |
| 5 | CI/CD Adjustments | Medium | Update scripts to handle unformatted fallback (if needed) |
| 6 | Team Training | Low | Share keyboard shortcuts (e.g., click links in VS Code) |
file:// URLs), legacy terminals (unformatted but readable).composer require --dev in a feature branch).level: 8).grep scripts) still works.phpstan.neon config.editorUrl setup for PhpStorm/VS Code.editorUrl for team-specific IDEs.composer.json dev dependencies if widely adopted.webstorm://).| Scenario | Impact | Mitigation |
|---|---|---|
| Terminal lacks clickable links | Output is less interactive but still readable | Use file:// URLs or IDE-specific editorUrl |
| PHPStan version incompatibility | Formatter disables gracefully | Monitor GitHub for updates |
| Custom PHPStan rules conflict | No impact—formatter |
How can I help you explore Laravel packages today?