- What is sebastian/phpdcd used for?
- sebastian/phpdcd is a command-line dead code detector that scans PHP codebases for unused functions and methods. It is a dev-time static-analysis tool, not an application library, so it should not run in production or become part of Laravel runtime architecture. Teams use it to identify candidates for cleanup, but findings need manual review.
- How do I install phpdcd in a Laravel project?
- Install it as an isolated Composer dev tool or in a CI-only container rather than as a shared application dependency. The evaluation recommends a separate Composer project or tooling image to avoid conflicts with the Laravel lockfile. Before adding it to the main composer.json, run a time-boxed compatibility spike.
- Is sebastian/phpdcd compatible with Laravel 10, 11, and 12?
- Compatibility is not guaranteed. The package is archived and likely constrained to older PHP and PHP-Parser ecosystems, while Laravel 10, 11, and 12 applications commonly run on PHP 8.x. Validate Composer constraints, parser behavior, and Laravel version support before adoption.
- Which PHP versions does phpdcd support?
- The provided context does not list exact PHP version constraints, but the package is archived and likely limited to older PHP and PHP-Parser versions. Support for PHP 8.x syntax must be verified with a compatibility spike. Do not assume modern PHP compatibility until tested against your codebase.
- Does phpdcd understand Laravel facades, Eloquent relationships, and service container bindings?
- It has high false-positive potential with Laravel's dynamic patterns, including service container bindings, facades, Eloquent magic, events and listeners, routes, policies, and Blade or Livewire references. Findings should be treated as candidates for review, not automatic deletion instructions. Document exclusions for these Laravel conventions before using it in CI.
- Can I run phpdcd in a Laravel CI pipeline?
- Yes, but start advisory and non-blocking. Run it against app/, src/, or selected paths while excluding vendor/, storage/, generated code, and framework entrypoints. Establish a baseline, triage false positives, then gate only new or changed code after noise is controlled.
- Does phpdcd support baselines or suppressing false positives?
- The available context does not confirm a built-in baseline or suppression mechanism. In practice, teams should use path scoping, documented exclusions, and manual triage to control noise. If suppression is required, consider a wrapper, fork, or a maintained static-analysis alternative.
- Is sebastian/phpdcd still maintained?
- No. The package is archived, has no upstream fixes or support path, and zero dependents indicate low current ecosystem validation. Adopting it transfers maintenance burden internally. Pinning a version reduces surprise but does not provide security or PHP compatibility updates.
- What license does sebastian/phpdcd use?
- The evaluation flags a NOASSERTION license status, meaning the exact license terms are ambiguous and require legal review. Do not adopt or fork the package without confirming the applicable license. License ambiguity adds legal and operational overhead.
- What are the best alternatives to phpdcd for Laravel dead code detection?
- The context recommends a maintained static-analysis stack rather than adopting an archived tool. No specific replacement is named in the source, so evaluate modern static-analysis tools that understand Laravel conventions and support PHP 8.x. A fork of phpdcd is only worth considering if dead-code detection is a priority and no maintained alternative covers the need.