- How do I install soyhuce/phpinsights-formatter in a Laravel project?
- Install it as a dev dependency with composer require --dev soyhuce/phpinsights-formatter. Then add the formatter's fully qualified class name to the formatters array in your phpinsights.php configuration file. No migrations, service providers, or published config files are required beyond that single edit. Run phpinsights locally to confirm the new output before wiring it into CI.
- Which PHP Insights versions does this formatter support?
- The formatter implements an interface owned by PHP Insights, so it must match the major version you have installed. This is the highest-probability integration blocker, especially because formatter interfaces have changed across PHP Insights releases. Check the package's composer.json constraint for nunomaduro/phpinsights against your pinned version and run a dry-run resolve before merging. Release 2.1.0 changes nothing in src, so its integration steps are identical to 2.0.0.
- Does this package affect my Laravel application at runtime or in production?
- No. It is a dev-only tooling package that sits entirely in the static-analysis and CI layer, with no service container bindings, middleware, database, or queue usage. It is consumed only by the formatters array in phpinsights.php and by CI jobs that invoke the phpinsights binary. Production blast radius is effectively zero.
- How do I compare the new formatter output with my existing one before switching?
- The formatters array in phpinsights.php accepts multiple entries, so you can keep your current formatter alongside the new one for one iteration. Run PHP Insights, compare the two outputs, and then drop the old entry once you are satisfied. This makes the migration a non-destructive A/B test rather than a hard cutover.
- Does version 2.1.0 of soyhuce/phpinsights-formatter contain breaking changes?
- No. The release is semver-minor and backwards compatible according to the changelog, with no deprecations and no behaviour changes to the formatting output. The diff contains CI workflow dependency bumps, a README update, and a PHP 8.3 test-matrix addition, with nothing changed in src. Upgrading from 2.0.0 requires no code changes on your side.
- Does this package support PHP 8.3, and which PHP versions can I use?
- PHP 8.3 is now exercised in the CI matrix, which is a useful compatibility signal for teams standardising on 8.3. However, test coverage and constraint widening are not the same thing, so confirm the declared php constraint in composer.json before assuming 8.3 is officially allowed. There is no stated conflict with PHP 8.1 or 8.2.
- Can I use this formatter in GitHub Actions or GitLab CI pipelines?
- Yes, it is designed for CI jobs that invoke the phpinsights binary, and it is most valuable when you need platform-native output such as CI annotations, PR comments, or report artifacts. Before adopting it, verify that the emitted output format maps to your CI platform's annotation or report ingestion. Also check whether the output schema is stable enough to diff over time, since report churn can create noisy pull request diffs.
- How risky is adding soyhuce/phpinsights-formatter to an existing quality gate?
- Overall risk is low: it is a dev-only dependency with no production blast radius and it is trivially removable. The main long-term concerns are maintenance-oriented, namely a small single-vendor package with a narrow contributor base and bus-factor risk. There is also a version-pinning risk, because a future PHP Insights major could break the formatter and turn CI pipelines red, which is annoying rather than dangerous.
- How do I roll back or remove the package if it does not work out?
- Remove the formatter entry from the formatters array in phpinsights.php and run composer remove soyhuce/phpinsights-formatter. Because the package adds no data stores, schema changes, or runtime bindings, there is nothing else to clean up. The rollback is effectively a one-line revert plus the Composer removal.
- Should I adopt PHP Insights just to use this formatter, and what are the alternatives?
- No. This package is a formatting convenience, not a new capability, so it is only worth adding if your team already standardises on PHP Insights. If you have not adopted PHP Insights, its built-in console and JSON formatters or other quality tooling are the better starting point. The package is additive to an existing quality gate rather than a reason to create one.