Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Composer
  3. Composer-Unused

Composer-Unused

MITPHP0.9.6

A Composer tool that scans your PHP code to identify and show unused Composer dependencies.

GitHubGitHub
1.7k stars57 forks0 contributors

What is Composer-Unused?

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.

Target Audience

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.

Value Proposition

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.

Overview

Show unused composer dependencies by scanning your code

Use Cases

Best For

  • Identifying and removing unused Composer packages in large PHP repositories to reduce bloat.
  • Optimizing Symfony projects with predefined configuration sets that automatically scan framework-specific directories.
  • Enforcing code hygiene in CI/CD pipelines by integrating dependency usage checks.
  • Analyzing projects with incomplete autoload definitions by specifying additional files to parse per dependency.
  • Excluding specific directories or packages from analysis using named or pattern-based filters for customized scans.
  • Improving performance in development environments by automatically disabling XDebug during execution to avoid overhead.

Not Ideal For

  • Projects with heavy reliance on dynamic code loading or reflection, where static analysis may produce inaccurate results.
  • Teams needing immediate, zero-configuration analysis for non-standard project structures without predefined framework sets.
  • Environments where XDebug must remain enabled during tool execution for debugging purposes, as it's disabled by default.

Pros & Cons

Pros

Precise Symbol Detection

Scans actual code to identify which Composer package symbols are referenced, providing accurate insights beyond simple dependency chains.

Framework-Aware Scanning

Includes predefined configuration sets for Symfony, automatically scanning framework-specific directories like config/ and migrations/.

Performance Optimization

Automatically disables XDebug during execution to improve speed and memory usage, with an option to re-enable via environment variable.

Flexible Exclusion Mechanisms

Supports excluding directories and packages using command-line options or configuration files, with pattern-based filtering for scalability.

Cons

Installation Complexity

Local Composer installation is discouraged due to version conflicts, forcing users to manage PHAR files or use PHIVE, adding setup steps.

Static Analysis Blind Spots

May miss dependencies used dynamically, such as through string class names or runtime evaluations, unless manually configured with additional files.

Limited Out-of-the-Box Presets

Only provides a predefined configuration set for Symfony, requiring custom implementation for other frameworks or complex project setups.

Frequently Asked Questions

Quick Stats

Stars1,688
Forks57
Contributors0
Open Issues12
Last commit3 days ago
CreatedSince 2019

Tags

#hacktoberfest#composer#phar#dependency-management#code-quality#package-management#php#development-tools#static-analysis#php-parser

Built With

P
PHP

Included in

PHP32.5kComposer904
Auto-fetched 8 hours ago

Related Projects

OctoLinker Browser ExtensionOctoLinker Browser Extension

OctoLinker — Links together, what belongs together

Stars5,386
Forks284
Last commit2 years ago
SatisSatis

Simple static Composer repository generator - For a full private Composer repo use Private Packagist

Stars3,299
Forks529
Last commit4 days ago
Composer/Xdebug-HandlerComposer/Xdebug-Handler

Restart a CLI process without loading the xdebug extension.

Stars2,565
Forks33
Last commit7 days ago
Composer-PatchesComposer-Patches

Simple patches plugin for Composer

Stars1,725
Forks265
Last commit8 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub