- What is grifart/phpstan-oneline and how does it work with Laravel?
- grifart/phpstan-oneline is a PHPStan error-output formatter that renders each analysis issue on a single clickable line. In Laravel projects it is used indirectly through PHPStan or Larastan as a development-only tool. It does not change PHPStan checks, Laravel runtime behavior, or application architecture.
- How do I install grifart/phpstan-oneline in a Laravel project?
- Install it as a Composer require-dev dependency in a repository that already runs PHPStan or Larastan. Then configure PHPStan's errorFormat to use the formatter class provided by the package. No service provider or application code changes are required.
- Do I need Larastan to use grifart/phpstan-oneline?
- No, the package formats PHPStan output and does not require Larastan. Larastan is only relevant when you want Laravel-aware PHPStan rules in addition to the formatter. If you already use Larastan, keep your existing analysis command and only adjust the error output configuration.
- Which PHPStan versions does grifart/phpstan-oneline support?
- The provided context does not list a supported PHPStan version matrix, so check the package's Composer constraint before adopting it. Validate compatibility with your installed PHPStan and Larastan versions together, then pin the package in composer.lock. Because it plugs into PHPStan's formatter API, recheck support during PHPStan upgrades.
- How do I enable the grifart/phpstan-oneline formatter in phpstan.neon?
- Add the package as a require-dev dependency and set PHPStan's errorFormat option to the formatter class supplied by the package. Confirm the exact formatter class name for your installed PHPStan version, then run your existing PHPStan or Larastan command unchanged. Keep the previous configuration documented so you can revert to PHPStan's default formatter quickly.
- Does grifart/phpstan-oneline work in CI logs and GitHub Actions?
- It is intended to make long PHPStan reports easier to scan in CI logs and terminals by keeping issues compact. Before rolling it out, test your CI runner in non-TTY mode and check how it handles ANSI sequences, hyperlinks, and long log lines. Compare the output with PHPStan's default formatter to ensure your log tooling still parses it correctly.
- Does grifart/phpstan-oneline affect production or the Laravel runtime?
- No, it is a development tooling package that formats PHPStan analysis output. It should be installed as a dev dependency and does not add a Laravel service provider or change request lifecycle behavior. Production deployments should remain unaffected when dev dependencies are excluded.
- Will clickable error paths work in terminals, IDEs, and CI?
- Clickable output depends on terminal or CI support for hyperlinks and ANSI formatting, so validate it in your local terminal, IDE terminal, and CI environment. Some runners and log viewers may strip links or render escape sequences poorly. If clickable paths are unreliable, decide whether one-line formatting alone still provides enough value.
- Can one-line PHPStan output break CI annotations or log parsers?
- It can interact poorly with CI log parsers, annotation processors, ANSI handling, or log truncation because it changes PHPStan's rendered error format. Test the output against your existing CI tooling before broad adoption. Keep PHPStan's default formatter documented as an immediate fallback if annotations or parsing break.
- Is grifart/phpstan-oneline maintained and what are the alternatives?
- The package has low adoption signal, so treat it as a small developer-tooling dependency that needs periodic compatibility checks. PHPStan's built-in default formatter is the immediate fallback and requires no extra dependency. Be prepared to remove or fork the package if it becomes incompatible with your PHPStan or Larastan upgrade path.