ticketswap/phpstan-error-formatter
A minimalistic PHPStan error formatter that makes each error a clickable file and line link, avoids wrapping so errors use your full terminal width, highlights variables and class names, and visually truncates long file paths.
Scope and architecture fit. This is a pure presentation-layer plugin: a single PHPStan ErrorFormatter implementation registered through extension.neon and selected via parameters.errorFormat: ticketswap. It does not analyze code, ship rules, or touch runtime. For a Laravel/PHP codebase that already runs PHPStan as a dev dependency, the architectural footprint is effectively zero — it cannot affect production behavior, request latency, or deployment artifacts. Fit is strongest where PHPStan is already a gate (levels 6–10) and the default table formatter is the friction point, not where PHPStan adoption itself is undecided.
Integration feasibility. Composer dev dependency plus either phpstan/extension-installer auto-discovery or a single includes: line, plus one config parameter and an optional editorUrl. Realistically a sub-hour task for one engineer, verified by running PHPStan once and eyeballing output. Release history shows deliberate compatibility work — PHPStan 2 support (1.1.4), Windows support (1.2.5), relative paths (1.0.3), non-decorated/CI output handling (1.1.0, 1.2.4), PHP 8.1 baseline with older-version support in earlier tags. Verify exact PHP and PHPStan constraints against composer.json rather than README badges.
Technical risk (ranked).
src/App/../Entity/User.php) reduce log greppability, partially offset by the 1.3.0 "don't trim when an AI agent is detected" behavior. Long lines also inflate CI log volume on large error counts.file:///… or plain path) is functional but loses the core benefit.Key questions for the owner/team.
editorUrl paths consistently across the team?--error-format=github/json, which this package does not replace.Stack fit. Any Laravel/PHP repo on PHP 8.1+ running PHPStan 1.x or 2.x, with Composer-managed dev tooling. It coexists cleanly with phpstan/extension-installer, Larastan, and existing baselines because it changes only the renderer. No production dependency, no autoload impact, no framework coupling.
Migration path (low-risk, reversible).
ticketswap/phpstan-error-formatter as a require-dev entry with a caret constraint; commit the lockfile.extension.neon include (or rely on the installer, if adopted org-wide).parameters.errorFormat: ticketswap in the project phpstan.neon.editorUrl per dominant IDE (phpstorm://open?file=%%file%%&line=%%line%%, vscode://file/%%file%%:%%line%%) and document it — this is where most of the perceived value is actually created.Compatibility notes.
--error-format=github (or JSON) for annotation-producing steps and reserve ticketswap for human-facing local runs and archived CI logs. Do not let a cosmetic renderer become a pipeline dependency.editorUrl to host-visible paths or accept the degraded file:// fallback.Sequencing. Pilot in one high-PHPStan-adoption repo for two weeks with a named owner → collect qualitative feedback plus a small time-to-triage measurement → if positive, promote via a shared tooling package or CI template so config drift doesn't accumulate → add one line to onboarding docs → schedule a recurring check tied to PHPStan upgrades.
Maintenance. Near-zero steady-state cost: one dev dependency, one config block, Renovate/Dependabot handles bumps. The real maintenance event is a PHPStan major upgrade; budget a small spike there and pin a known-good formatter version ahead of the PHPStan bump.
Support. Self-serve and self-diagnosing. The failure signature is unambiguous (garbled or plain output), and rollback is deleting one config line. No on-call implications. Support burden concentrates on two questions — "why do my links not open?" (editor/terminal config) and "why is my path cut off?" (truncation) — both answerable once in documentation.
Scaling. Negligible CPU impact; the cost that scales is output volume: unwrapped lines can be very long on large error counts, which affects CI log storage, log-parser friendliness, and readability in narrow panes. Fine at typical Laravel error counts; worth a sanity check on a monorepo or a deliberately broken branch.
Failure modes and mitigations.
editorUrl mapping or accept fallback.Ramp-up. Minutes for an engineer familiar with PHPStan config; the README covers install, both installation modes, and editor URLs. The only training-worthy content is per-IDE editorUrl setup and the "this is display-only" caveat. Junior developers benefit disproportionately because scannable, per-error file/line links reduce navigation overhead and mentorship interrupts — but treat that as a hypothesis to validate in the pilot, not a forecast.
TPM recommendation. Adopt opportunistically as a low-cost developer-experience improvement behind a two-week, single-repo pilot with explicit exit criteria (triage-time delta and developer preference). Do not standardize org-wide, do not depend on it in CI gating logic, and do not attach quality, defect, or velocity metrics to it — 87 stars, zero dependents, and a single-vendor maintainer make it a convenience, not infrastructure.
How can I help you explore Laravel packages today?