grifart/phpstan-oneline
A PHPStan extension that formats each reported error on a single line, making analysis output easier to read, search, and parse in CI logs or terminals. Useful for grep-friendly error reports and cleaner build output.
Architecture fit. Dev-tooling only. This package is a PHPStan error-output formatter, not a Laravel runtime dependency. It fits Laravel projects indirectly through PHPStan/Larastan: PHPStan performs analysis, Larastan adds Laravel-aware rules, and this package improves how errors are rendered. It should not affect application architecture, request lifecycle, or production behavior.
Integration feasibility. Feasible with low effort: add as a Composer require-dev dependency, configure PHPStan’s errorFormat to use the package’s formatter, and keep existing PHPStan/Larastan CI commands unchanged. The main validation is confirming the exact formatter class/configuration for the installed PHPStan version and verifying clickable output in local terminals, IDEs, and CI logs.
Technical risk. Low blast radius because it only changes developer-facing error output. Risks are dependency and maintenance related: low adoption signal at 24 stars, unknown repository provenance, possible coupling to PHPStan formatter APIs, and version lag against PHPStan/Larastan upgrades. Output formatting could also interact poorly with CI log parsers, ANSI/terminal link handling, or log truncation. It is not a platform-critical dependency.
Key questions. Which PHPStan versions are supported? Does it work with the team’s Laravel/Larastan version matrix? Does clickable output work in common terminals, IDEs, and GitHub Actions or other CI? Is the PHPStan formatter API stable enough to survive upgrades? Who maintains the package? Can we pin a version and fall back to PHPStan’s default formatter quickly? Does it alter error text in ways that affect CI annotations or tooling?
Stack fit. Add as a development-only Composer dependency in Laravel repositories that already run PHPStan or Larastan. No service provider, runtime configuration, or application code changes are required. Production deployments and runtime autoloading should remain unaffected when dev dependencies are excluded.
Migration path. No data migration. Pilot in one Laravel repository: add the package, configure the formatter in phpstan.neon, compare output against the default formatter, and validate local and CI behavior. If accepted, roll out repository by repository. Document the default formatter as an immediate fallback.
Compatibility. Validate PHP version, PHPStan version, Larastan version, and Composer resolution together. Pin the package version via composer.lock. Test local terminal, IDE terminal, and CI log rendering. Confirm behavior when the runner is non-TTY or does not support hyperlinks/ANSI sequences.
Sequencing. 1) Confirm supported PHPStan/Larastan versions and formatter configuration. 2) Add the dependency in a pilot repository. 3) Update phpstan.neon to use the formatter. 4) Run local and CI comparisons against the default output. 5) Document usage, limitations, and fallback. 6) Roll out to additional repositories. 7) Recheck compatibility during PHPStan upgrades.
Maintenance. Low ongoing code footprint, but still requires periodic Composer and PHPStan upgrade checks. Because adoption is low, the team should be prepared to remove or fork the package if it becomes incompatible. Budget a small recurring review rather than a dedicated support effort.
Support. Community OSS under MIT with no vendor SLA. Assign an internal owner in developer tooling or platform engineering. Provide a documented fallback to PHPStan’s default formatter so developers are not blocked if the package breaks.
Scaling. Negligible compute or infrastructure impact; it only formats analyzer output. It may improve readability and reduce noise in CI, but one-line output can produce long lines, so check CI log limits and annotation behavior. Scaling is per repository and per CI job, not a shared service concern.
Failure modes. Incompatible PHPStan formatter API, missing formatter class after upgrade, broken clickable paths, ANSI/hyperlink issues in CI, lost CI annotations, log truncation, or package abandonment. Mitigate with a pinned version, pilot rollout, documented fallback, and a simple removal path.
Ramp-up. Low. Developers need a short note on the added dev dependency, the phpstan.neon change, clickable output behavior, and how to revert. The TPM leverage is developer productivity and CI readability, not architectural capability; adopt as an optional developer-experience improvement after a pilot.
How can I help you explore Laravel packages today?