A Composer tool that scans your PHP code to identify and show unused Composer dependencies.
composer-unused is a static analysis tool for PHP projects that identifies Composer dependencies installed but not actually used in the codebase. It scans code to detect which package symbols are referenced, helping developers maintain cleaner projects by removing unnecessary packages. This solves the problem of accumulating unused dependencies in large repositories, reducing maintenance overhead.
PHP developers working on medium to large projects with many Composer dependencies, particularly those using frameworks like Symfony where dependency bloat can accumulate. It's also valuable for teams focused on code hygiene and performance optimization.
Developers choose composer-unused because it provides accurate, actionable insights through static analysis of symbol usage, unlike basic tools that only show dependency chains. Its unique selling points include framework-specific configuration sets (e.g., for Symfony), performance optimizations like automatic XDebug disabling, and flexible filtering options for excluding directories or packages.
Show unused composer dependencies by scanning your code
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Scans actual code to identify which Composer package symbols are referenced, providing accurate insights beyond simple dependency chains.
Includes predefined configuration sets for Symfony, automatically scanning framework-specific directories like config/ and migrations/.
Automatically disables XDebug during execution to improve speed and memory usage, with an option to re-enable via environment variable.
Supports excluding directories and packages using command-line options or configuration files, with pattern-based filtering for scalability.
Local Composer installation is discouraged due to version conflicts, forcing users to manage PHAR files or use PHIVE, adding setup steps.
May miss dependencies used dynamically, such as through string class names or runtime evaluations, unless manually configured with additional files.
Only provides a predefined configuration set for Symfony, requiring custom implementation for other frameworks or complex project setups.