Working in a big repository with multiple people, sometimes you might lose track of your required composer packages. You have so many packages you can't be sure if they are used or not.

composer-unused to the rescue.

Programming language: PHP
License: MIT License
Tags: Dependency Management     PHP7     Package     Composer     Plugin     Unused     Php-parser    
Latest version: v0.7.7

composer-unused alternatives and similar libraries

Based on the "Dependency Management" category.
Alternatively, view composer-unused alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of composer-unused or a related project?

Add another 'Dependency Management' Library



A Composer tool to show unused Composer dependencies by scanning your code.

Created by Andreas Frömer and contributors, logo by Caneco.

:fire::fire: Now available as Github Action on the Marketplace :fire::fire:


When working in a big repository, you sometimes lose track of your required Composer packages. There may be so many packages you can't be sure if they are actually used or not.

Unfortunately, the composer why command only gives you the information about why a package is installed in dependency to another package.

How do we check whether the provided symbols of a package are used in our code?

composer unused to the rescue!



PHAR (PHP Archive) (recommended)

Install via phive or grab the latest composer-unused.phar from the latest release:

$ phive install composer-unused

$ curl -JOL https://github.com/icanhazstring/composer-unused/releases/latest/download/composer-unused.phar


If you have a lot of projects and don't want to install this package per project, simply install it as a global dependency (e.g. on your CI):

$ composer global require icanhazstring/composer-unused


You can also install composer-unused as a local development dependency:

$ composer require --dev icanhazstring/composer-unused

:exclamation: Beware: Local (or global) requirement might lead to issues related to outdated or replaced dependencies and composer-unused might not work as intended!


Depending on the kind of your installation the command might differ.


The phar archive can be run directly in you project:

$ php composer-unused.phar


Having composer-unused as a local or global dependency you can run it as an composer-plugin:

$ composer unused

Exclude folders and packages

Sometimes you don't want to scan a certain directory or ignore a Composer package while scanning. In these cases, you can provide the --excludeDir or the --excludePackage option. These options accept multiple values as shown next:

$ php composer-unused.phar --excludeDir=config --excludePackage=symfony/console
$ php composer-unused.phar \
    --excludeDir=bin \
    --excludeDir=config \
    --excludePackage=symfony/assets \

Make sure the package is named exactly as in your composer.json

Ignore by configuration

You are also able to exclude packages by configuration. For this, you need to provide the extra directive in your composer.json file.

    "extra": {
        "unused": [

Suppress progress bar

If you run composer-unused in CI the console progressbar often messes up your logs files. To suppress them use:

`$ php composer-unused.phar --no-progress`


If you encounter some errors, try running:

$ php composer-unused.phar -vvv

This command will enable the debug mode and create an error report beside your composer.json.



Please have a look at [CHANGELOG.md](CHANGELOG.md).


Please have a look at [CONTRIBUTING.md](CONTRIBUTING.md).

Code of Conduct

Please have a look at [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).


This package is licensed under the [MIT License](LICENSE).

*Note that all licence references and agreements mentioned in the composer-unused README section above are relevant to that project's source code only.