Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Phpstan Error Formatter

Phpstan Error Formatter Laravel Package

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.

View on GitHub
Deep Wiki
Context7

A minimalistic PHPStan error formatter that makes static analysis output easier to scan and act on. It prints each finding as a clear, single-line entry with a clickable file + line link (when supported), helping you jump straight to the source.

Designed for fast terminal workflows, it keeps messages readable and adds lightweight highlighting—without the default table wrapping.

  • Clickable file/line links per error (terminal-dependent)
  • No wrapping: errors stay on one line for quick scanning
  • Naive syntax highlighting for variables, FQCNs, and common types
  • Visually truncated paths while preserving the real link target
  • Fallback file:// URLs for environments without link support
Frequently asked questions about Phpstan Error Formatter
How do I integrate this formatter into my Laravel project’s PHPStan setup?
Run `composer require --dev ticketswap/phpstan-error-formatter` and add `parameters: errorFormat: ticketswap` to your `phpstan.neon`. If using `phpstan/extension-installer`, no extra steps are needed—it auto-loads the extension.
Will this work with Laravel’s Artisan commands or CI/CD pipelines?
Yes, it’s designed for CLI output. For CI, ensure your terminal/IDE supports clickable links (e.g., GitHub Actions with VS Code). If not, it falls back to readable plaintext with `file://` URLs for IDEs like PhpStorm.
Does this formatter support PHPStan 1.x, 2.x, or 3.0 for Laravel projects?
It officially supports PHPStan 1.x and 2.x. PHPStan 3.0 compatibility is untested—check GitHub issues for updates. Laravel projects typically use 1.x/2.x, so this is unlikely to be a concern.
Can I customize the IDE/editor URL scheme (e.g., for PhpStorm or VS Code)?
Absolutely. Add `editorUrl: 'vscode://file/%%file%%:%%line%%'` or `phpstorm://` to your `phpstan.neon` under `parameters`. This overrides the default clickable link behavior.
Will this break existing PHPStan rules or slow down analysis in Laravel?
No, it’s a presentation layer only—no core logic changes. Benchmarks show <50ms overhead for highlighting. Laravel’s static analysis workflows (e.g., `phpstan:parallel`) remain unaffected.
How does it handle long file paths in Laravel’s nested `app/` or `src/` directories?
Paths are visually truncated (e.g., `src/App/../Entity/User.php`) but retain full clickable links. For example, `vendor/ticketswap/...` becomes `[vendor/...]` while keeping the original path intact.
Is there a fallback if this formatter fails to load in production?
Yes, PHPStan gracefully degrades to its default formatter. No runtime errors occur—just standard output. Ideal for CI or environments where extensions might be disabled.
Does this work with Laravel Pint or other code-quality tools?
Yes, it’s independent of Pint. Use it alongside Pint or Telescope for consistent error formatting. The formatter focuses on PHPStan output, so it won’t interfere with other tools.
Can I use this with custom PHPStan rules or Laravel-specific extensions?
Absolutely. The formatter is rule-agnostic—it processes all PHPStan errors uniformly. Test with your custom rules to ensure no conflicts, but it’s designed to work with any extension.
How do I test if clickable links work in my terminal or CI environment?
Run `phpstan` in your terminal and hover over file paths. For CI, check if your runner (e.g., GitHub Actions) supports ANSI escape codes. If not, verify `file://` URLs are parsed by your IDE or CI logs.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport