drew/debug-statements-fixers
Laravel Pint fixers that automatically detect and remove leftover debug statements such as dd(), dump(), var_dump(), print_r(), and ray() from your PHP codebase. Easily keep commits and production code clean, consistent, and free of accidental debugging calls.
Architecture fit. drew/debug-statements-fixers is not a runtime library. It is a thin collection of custom fixers for friendsofphp/php-cs-fixer that strips var_dump, print_r, dd, dump, die/exit and similar artefacts during a static-analysis pass. Architecturally that is a good fit for us: it lives entirely in the dev/CI lane, has no production code path, no service container binding, no Laravel provider, and no runtime coupling. It is a lint rule wearing a package costume.
Integration feasibility. The blocker is era, not design. Last release 2018-04-19 predates php-cs-fixer 3.x, which changed the FixerInterface contract (notably getName() removal and supports() semantics). Any modern Laravel app on PHP 8.x will almost certainly resolve to a dependency conflict at install time. Because MIT-licensed fixers are individually small (roughly 30–80 lines each), the realistic path is vendor-and-port rather than composer require. Two days of work, not two hours, because each ported fixer needs a regression test to prove it still matches what it claims to match.
Technical risk. Supply-chain risk is low (dev-only, MIT, no transitive runtime deps beyond php-cs-fixer). The real risks are: (1) abandonment — no upstream fixes, no compatibility work, we inherit ownership permanently; (2) install fragility — a composer update on php-cs-fixer can silently disable the fixers, which is worse than not having them, because the team believes it has a guardrail it does not have; (3) false positives on legitimate exit/die in artisan commands, queue workers, or CLI scripts, and on dump() inside test helpers or intentionally-broken fixtures.
Key questions. Does it support php-cs-fixer 3.x at all, or only ^2.x? Which PHP version constraints are pinned? Does it cover dd, dump, ray, ddd, var_export, and error_log, or only the 2018-era set? Are the fixers token-aware, or regex-based on raw content (the latter mangles strings and comments)? Do they operate on Blade/PHP templates and Pest/PHPUnit files? Is there a @debug/@phpstan-ignore suppression convention? Who owns the port if we adopt?
Stack fit. PHP 8.x / Laravel 10–12 / php-cs-fixer 3.x on a standard CI pipeline (GitHub Actions or equivalent). The package as published does not fit this stack cleanly; the idea does.
Recommended path (in order of preference):
SlevomatCodingStandard's ForbiddenFunctions sniff (or a 20-line custom sniff) banning var_dump, print_r, dd, dump, ray, exit outside an allowlist. Maintained, battle-tested, zero porting cost, and it fails closed.tools/php-cs-fixer/, update to the 3.x FixerInterface, register via a local config, and add a per-fixer unit test asserting matched/non-matched code samples. Keeps auto-fixing rather than just detection.composer require as published. Only viable on a legacy PHP 7.0/php-cs-fixer 2.x codebase. Not our case.Migration path. No data migration, no schema change, no rollback risk — this is a CI-only change and can be reverted with one config commit.
Compatibility caveats. If the team standardises on Laravel Pint, confirm whether your Pint version supports registering external custom fixers; if not, run php-cs-fixer as a separate CI job rather than abandoning the rule. Pin php-cs-fixer exactly in CI so a minor bump cannot silently no-op the fixers.
Sequencing.
Maintenance. Adopting the package as-is means permanent maintenance with no upstream. Ported fixers are small enough (a few hundred lines total) that the ongoing cost is genuinely low — perhaps half a day per php-cs-fixer major version — but it must have a named owner in the platform or developer-experience backlog, or it will rot and become a false sense of security.
Support. No vendor, no issues triage, no CVE feed we can rely on. Because the dependency is dev-only, a compromised or broken release cannot reach production traffic; blast radius is CI machines and developer laptops, which is manageable but not zero (composer scripts, post-install hooks).
Scaling. Negligible. Static analysis over a few thousand files runs in seconds and parallelises well in php-cs-fixer 3.x. No per-request cost, no memory footprint, no effect on deploy size.
Failure modes to monitor.
dd() that must be flagged, failing the build if it is not.exit in console commands or dump() in debugging utilities. Mitigate with an allowlist path and a suppression comment convention..env dumps, compiled assets, and Pest test files are not covered, so a green build does not mean "no debug statements." Pair with the PHPStan rule and a PR checklist item.Ramp-up. Low for consumers (one config entry, one doc paragraph, one CI gate). Moderate for whoever ports it — a mid-level PHP engineer with php-cs-fixer familiarity needs 1–2 days including tests. The organisational risk is not difficulty, it is the 2018 timestamp: an abandoned 22-star package with zero dependents is a signal that nobody has run this in anger on a modern stack. Treat the score of 1.51 alongside an opportunity of 11.56 as "the problem is real, this artefact is not the solution" — validate the concept, then build or borrow a maintained implementation rather than depending on this one.
How can I help you explore Laravel packages today?