yamadashy/phpstan-friendly-formatter
A PHPStan error formatter that shows the problematic code right where each error occurs, plus a summary of error identifiers and frequencies. Install via Composer, include extension.neon, and set errorFormat to friendly for faster debugging.
Architecture fit: Unchanged and still strong. PHPStan's formatter plugin architecture accommodates this release without structural change; v1.5.0 adds a presentation-layer concern (token highlighting of expected/actual types) rather than new analysis behavior. The implementation is deliberately scoped: highlighting is applied by semantic role (declared vs. found) rather than string position, and unrecognized message shapes pass through unchanged. That "best-effort, no configuration" design is the right architectural trade-off for a formatter and keeps the blast radius small.
Integration feasibility: High. Same Packagist package (yamadashy/phpstan-friendly-formatter), same explicit formatter registration, standard composer update path. No new configuration surface was introduced, so existing installations inherit the feature passively.
Technical risk: Low-to-moderate, and lower than the prior assessment on the version-compatibility axis. v1.5.0 explicitly tests against PHPStan 2.2.x AnalysisResult constructor changes (#49, #54), which resolves the previously flagged "PHPStan version compatibility unverified" concern for the 2.x line. The residual risk is no longer about correctness of analysis output but about rendering: ANSI color escapes emitted into CI logs, artifacts, and log-aggregation pipelines that may not strip them. Best-effort matching also means inconsistent visual treatment across message shapes, which is cosmetic rather than functional.
Key questions: Does our CI/log pipeline strip or render ANSI escapes (GitHub Actions renders them; raw log stores and some parsers do not)? Do we need a no-color fallback for non-TTY environments or accessibility (red/green is the most common color-vision deficiency pairing)? Which PHPStan version does each service pin, and are we all on 2.x? Are any downstream consumers parsing formatter output as text (dashboards, PR comment bots, diffing tools) that would now see escape sequences?
Stack fit: Native, unchanged. Drop-in replacement for the existing formatter within a Laravel PHPStan setup; the new highlighting is internal to message rendering and does not alter exit codes, error counts, or baseline behavior. CI annotation features (GitHub Actions/TeamCity) remain intact.
Migration path: Standard composer update yamadashy/phpstan-friendly-formatter to v1.5.0. Zero configuration changes; no migration steps. Because the feature is always-on with no toggle documented, treat it as an opt-out-by-pinning change if ANSI output causes problems rather than an opt-in.
Compatibility: No breaking changes noted. Now empirically validated against PHPStan 2.2.x, strengthening the earlier "supports v1+ (implied)" claim into tested support for the current 2.x line. Teams on older PHPStan 1.x should confirm behavior in their own CI before rolling forward.
Sequencing: Adopt in a single low-risk PR on one representative pipeline first, inspect the rendered output in both an interactive terminal and the CI log viewer, then roll to remaining services. No prerequisites; can be batched with routine dependency updates.
Maintenance: Public repository with active, responsive maintenance; this release shows both a community-suggested feature and a proactive upstream-compatibility fix within the same cycle — a healthy signal for a small utility dependency. No new transitive dependencies of note.
Support: Clear release notes with visual examples and explicit statement of the highlighting rule. Contributor credit and issue linkage (#13, #49, #54, #55) make provenance traceable. Documentation of edge-case behavior ("best-effort, unmatched messages unchanged") preempts the most likely support question.
Scaling: Negligible. Highlighting is string-level formatting during CLI reporting, with no measurable impact on analysis runtime or memory; cost scales with the volume of emitted errors, not with codebase size.
Failure modes: Degraded to prior behavior if message shapes change in future PHPStan releases — cosmetic, non-blocking. Realistic friction points are ANSI escape codes polluting raw CI logs or log aggregators that don't strip them, and reduced readability for red/green color-blind engineers reviewing output. Both are presentation-layer issues with simple mitigations (pin the version, strip ANSI in the pipeline, or rely on the surrounding uncolored text). No crash, DI, or analysis-correctness failure paths introduced by this release.
Ramp-up: Very low. No configuration to learn; the green-declared / red-found convention is self-explanatory and the release notes provide a one-line mental model plus examples, so developers get the readability benefit on first run.
How can I help you explore Laravel packages today?