Download the PHP package icanhazstring/composer-unused without Composer

On this page you can find all versions of the php package icanhazstring/composer-unused. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-unused

composer-unused logo

composer-unused

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

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

⚠️ If you want to use this tool as composer-plugin head over to composer-unused-plugin.

Motivation

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!

Installation

⚠️ This tool heavily depends on certain versions of its dependencies. A local installation of this tool is not recommended as it might not work as intended or can't be installed correctly. We do recommened you download the .phar archive or use PHIVE to install it locally.

PHAR (PHP Archive) (recommended)

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

phive install composer-unused
curl -OL https://github.com/composer-unused/composer-unused/releases/latest/download/composer-unused.phar

Local

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

composer require --dev icanhazstring/composer-unused

Usage

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

Note: Packages must be installed via composer install or composer update prior to running composer-unused.

PHAR

The phar archive can be run directly in you project:

php composer-unused.phar

Local

Having composer-unused as a local dependency you can run it using the shipped binary:

vendor/bin/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 \
    --excludePackage=symfony/console

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

Configuration

You can configure composer-unused by placing a composer-unused.php beside the projects composer.json This configuration can look something like this: composer-unused.php

Ignore dependencies by name

To ignore dependencies by their name, add the following line to your configuration:

Ignore dependencies by pattern

To ignore dependencies by pattern, add the following line to your configuration

You can ignore multiple dependencies by a single organization using PatternFilter e.g. /symfony\/.*/

Additional files to be parsed

Per default, composer-unused is using the composer.json autoload directive to determine where to look for files to parse. Sometimes dependencies don't have their composer.json correctly set up, or files get loaded in another way. Using this, you can define additional files on a per-dependency basis.

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 under the MIT License.


All versions of composer-unused with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
composer-unused/contracts Version ^0.3
composer-unused/symbol-parser Version ^0.2.1
nikic/php-parser Version ^4.15
ondram/ci-detector Version ^4.1
phpstan/phpdoc-parser Version ^1.12
psr/container Version ^1.0 || ^2.0
psr/log Version ^1.1 || ^2 || ^3
symfony/config Version ^4.4 || ^5.4 || ^6.0 || ^7.0
symfony/console Version ^4.4 || ^5.4 || ^6.0 || ^7.0
symfony/dependency-injection Version ^4.4.8 || ^5.4 || ^6.0 || ^7.0
symfony/property-access Version ^4.4 || ^5.4 || ^6.0 || ^7.0
symfony/serializer Version ^4.4 || ^5.4 || ^6.0 || ^7.0
symfony/validator Version ^4.4 || ^5.4 || ^6.0 || ^7.0
webmozart/assert Version ^1.10
webmozart/glob Version ^4.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package icanhazstring/composer-unused contains the following files

Loading the files please wait ....