- What does ticketswap/phpstan-error-formatter do?
- It is a presentation-layer PHPStan error formatter that changes how findings are printed in your terminal. Each error gets its own clickable file and line link, output avoids table wrapping, variables and class names are naively highlighted, and long paths are visually truncated. It does not add analysis rules or change PHPStan findings.
- How do I install ticketswap/phpstan-error-formatter in a Laravel project?
- Install it as a Composer dev dependency with composer require --dev ticketswap/phpstan-error-formatter. If phpstan/extension-installer is installed, the extension is discovered automatically; otherwise add vendor/ticketswap/phpstan-error-formatter/extension.neon to the includes section of your PHPStan config. Then set parameters.errorFormat to ticketswap and run PHPStan once to verify the output.
- How do I configure PHPStan to use the ticketswap error formatter?
- Add errorFormat: ticketswap under parameters in your PHPStan configuration. If you need consistent editor links, configure the optional editorUrl setting for your environment. Manual installs also require the extension.neon include unless phpstan/extension-installer is present.
- Does this formatter support PHPStan 2?
- Release history shows PHPStan 2 support was added in version 1.1.4, with later releases adding Windows support and CI output handling. It still depends on PHPStan's formatter contract, so check the package composer.json for the exact PHPStan constraint before upgrading a major version.
- Which PHP versions are supported?
- The technical assessment lists PHP 8.1 as the baseline for current releases, with older PHP support in earlier tags. Confirm the exact PHP constraints in composer.json rather than relying on README badges.
- Does this package affect production behavior or runtime performance?
- No. It is a dev-only PHPStan formatter registered through extension.neon and selected by errorFormat, so it does not ship to production or affect request handling. The worst-case breakage is a failed or degraded PHPStan run in development or CI.
- Does it work in CI, Docker, or remote development containers?
- Clickable terminal links may not resolve in Docker, remote-dev containers, or CI log viewers because paths inside the container differ from the host. The formatter falls back to file:/// URLs or plain paths, which remain readable but lose the clickable benefit. For GitHub Actions or GitLab annotations, use PHPStan's github or json error formats instead.
- How do clickable links work in PHPStorm and different terminals?
- Clickable links depend on terminal support; PHPStorm's built-in editor does not support them, so the formatter prints a file:/// URL instead. In supported terminals, the file and line become clickable. You can set an editorUrl if your environment needs a consistent editor target.
- What are alternatives to ticketswap/phpstan-error-formatter?
- The built-in PHPStan table formatter is the direct alternative and requires no extra dependency. For CI annotations, PHPStan's github or json error formats are usually better suited. IDE inspections and editor integrations are alternatives for navigation, while this package mainly improves human-readable terminal triage.
- Is ticketswap/phpstan-error-formatter actively maintained and safe for long-term use?
- It is maintained by TicketSwap with low public adoption, so treat it as a swappable convenience rather than a platform standard. Release history shows deliberate compatibility fixes, but a PHPStan major could require an update to the formatter contract. Pin it as a dev dependency and be ready to remove it in one commit.