ticketswap/phpstan-error-formatter
Minimalistic PHPStan error formatter with clickable file+line links per error, no wrapping output, naive syntax highlighting, and visually truncated paths while preserving links. Easy install via Composer; enable with errorFormat: ticketswap.
extension.neon), ensuring compatibility with existing configurations (e.g., phpstan.neon).file:// URLs for IDEs (PhpStorm, VS Code). No dependency on specific IDE plugins or terminal emulators beyond basic link support.composer require --dev, with optional phpstan/extension-installer for automatic configuration. No build system modifications needed (e.g., Docker, CI/CD).errorFormat in phpstan.neon with a single-line change:
parameters:
errorFormat: ticketswap
No breaking changes to existing PHPStan rules or configurations.phpstorm://, vscode://) via editorUrl parameter. Teams using other IDEs (e.g., Eclipse, NetBeans) can extend this with minimal effort.file:// support. Mitigation: Document fallback behavior and provide manual navigation instructions for unsupported environments.App\${namespace}Entity) or obfuscated code. Mitigation: Validate against real-world codebases pre-release; supplement with custom regex rules if needed.Terminal/IDE Compatibility:
file:// URLs?file:// fallback documentation.PHPStan Configuration:
phpstan/parallel or phpstan/upgrade-wizard should test integration.CI/CD Impact:
Codebase Complexity:
App\${container->get('namespace')}Entity)?Adoption Barriers:
Future-Proofing:
ClassConstantValidation) benefit most from clear file/line references.laravel-pint, pestphp/pest) since it operates at the output layer.file:// fallback).phpunit, symfony/debug). Installs as a dev dependency, isolated from production.composer require --dev ticketswap/phpstan-error-formatter
Optional: Install phpstan/extension-installer for automatic config:
composer require --dev phpstan/extension-installer
phpstan.neon (or phpstan-baseline.neon):
includes:
- vendor/ticketswap/phpstan-error-formatter/extension.neon
parameters:
errorFormat: ticketswap
editorUrl: 'vscode://file/%%file%%:%%line%%' # or 'phpstorm://...'
vscode:// links).file:// fallback works out-of-the-box.grep patterns for error extraction with structured parsing (e.g., jq-like tools for JSON output).| Component | Compatibility | Mitigation |
|---|---|---|
| PHPStan 1.x/2.x | ✅ Full support | Test with your PHPStan version (e.g., phpstan/phpstan:^1.10). |
| PHP 8.1–8.5 | ✅ Supported | Downgrade if using PHP 7.4–8.0 (requires manual patching). |
| Laravel 9+ | ✅ No conflicts | Avoid phpstan config overrides in phpstan.neon. |
| Windows Paths | ✅ Supported (since v1.2.5) | Test with file:///C:/path/to/file.php links. |
| Custom PHPStan Rules | ✅ No impact | Rules must output standard PHPStan error objects. |
| CI/CD Parsing Scripts | ⚠️ May require updates | Use structured output (e.g., --generate-report=json) for reliability. |
How can I help you explore Laravel packages today?