48

GitHub - icanhazstring/composer-unused: Show unused composer packages by scannin...

 6 years ago
source link: https://github.com/icanhazstring/composer-unused
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

README.md

composer-unused

Show unused packages by scanning your code

Motivation

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

You can use composer why package/A but that only gives you information about why this package is installed in dependency to another package.

What if you need to find out if the provided namespaces of the package are used in your code?

composer unused to the rescue!

usage

Installation

Run

$ composer global require icanhazstring/composer-unused

Usage

Run

$ composer unused

Example (doctrine/orm)

vagrant@ubuntu-bionic:/vagrant/doctrine/orm$ composer unused

Loading packages
----------------

 Loading 15 requirements
 15/15 [-----------------------------] 100%

 ! [NOTE] Skipped 2 requirements. No package found or invalid constraint.                                               

 * php
 * ext-ctype

 ! [NOTE] Found 13 packages to be checked.                                                                              

Scanning files...
-----------------

 1174/1174 [-----------------------------] 100%

Found 13 usued and 0 unused packages

Results
-------

 Used packages
 * doctrine/annotations ✓
 * doctrine/cache ✓
 * doctrine/collections ✓
 * doctrine/dbal ✓
 * doctrine/event-manager ✓
 * doctrine/inflector ✓
 * doctrine/instantiator ✓
 * doctrine/persistence ✓
 * doctrine/reflection ✓
 * ocramius/package-versions ✓
 * ocramius/proxy-manager ✓
 * symfony/console ✓
 * symfony/var-dumper ✓

 Unused packages

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md.

License

This package is licensed using the MIT License.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK