icanhazstring/composer-unused
composer-unused detects and removes unused Composer dependencies in PHP/Laravel projects. It analyzes your codebase to find packages not referenced, reports what can be safely removed, and helps keep composer.json/lock lean and maintainable.
__root__ as default package name by @icanhazstring in https://github.com/composer-unused/composer-unused/pull/671debug:provided-symbols command by @llaville in https://github.com/composer-unused/composer-unused/pull/626$name must not be accessed before initialization" by @VincentLanglet in https://github.com/composer-unused/composer-unused/pull/562--output-format option
default and githubgithub can be used to annotate PRCiDetector to change output format according to the current ci environmentsymfony/dependency-injection to leverage autowiringcomposer-unused.php)Lexer\Emulative to use the current php version instead of latest oneis_dir() check from LocalRepository to avoid crashing file_get_contentsbox-project/box versioncomposer.json does not exist in given pathFilter was marked as unused again after being already usedIgnored section againcomposer-unused/symbol-parser to 0.1.7bin/composer-unused --versioncomposer-json which can be used to parse external projects.
This will default to the current working directory.composer.json is not readablebin/composer-unused to be used as standalone binarylibrary instead of composer-plugincomposer-plugin (will be supported using composer-unused/composer-unused-plugin)7.3--ignore-exit-code is used by @pascalheidmann in https://github.com/composer-unused/composer-unused/pull/396psr/log v2 and 3 #200 (thanks to [@simPod](https://github.com/simPod))InstanceofStrategy which detects usages in instanceof expressions #100phar filebin/composer-unusedcomposer/composer into root requirements as its required to run bin/composer-unused--no-progress to suppress progress bar for CIbin/composer-unused was unable to detect vendor/autoload.php when run as direct depdendencyphar supportbin/composer-unused as another entry pointcomposer/composer into root requirements as its needed to run bin/composer-unusedZend\ServiceManager in configuration files-d and -p as they could be already in usepsr/container-interface implementation as a replacement for zendframework/zend-servicemanager--excludeDir|-d and --excludePackage|-p)symfony-bundle typesFixed an issue where a package could provide an empty as well as a valid namespace
{
"autoload": {
"psr-4": {
"": "src/",
"A\\": "src/"
}
}
}
Namespace\Foobar::class was not recognized as usage #29library #25 composer-schema#typeunused if:
autoload-dev provided a needed namespaceChange the way how the plugin searched for usages
Previously it used only autoload and autoload-dev directives of the projects own composer.json.
This was changed so that now every file matching *.php beside the composer.json will be scanned.
With the exception that vendor is always excluded
--excludeDir|-xd to add additional folders to exclude from scan--excludePackage|-xp to add a package to ignore during scan-vvv to enable debug mode and create a dump fileImproved:
Improved:
Initial Release
How can I help you explore Laravel packages today?