Download the PHP package dbublik/unused-class-hunter without Composer

On this page you can find all versions of the php package dbublik/unused-class-hunter. 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 unused-class-hunter

Unused class hunter

Detects unused classes in your PHP codebase.

PHP Version Requirement License Tests Lint Code coverage Mutation score

Installation

Usage

After installation, you can run the following command to start hunting:

And that’s it! The Hunter will scan your entire codebase and find all unused classes. If you want to delete them immediately, just run the command:

Customization

Config:

Most likely, after the first run, the Hunter will find classes that are actually used. In this case you can help it by creating a configuration file .unused-class-hunter.php in the root of the project:

If your config file has another path, you can specify this via the "config" option:

Ignoring classes:

If you want to ignore certain classes, you have three options. The first two are to specify the classes or the attributes of these classes in the config:

The third option is to use one of our "filter". In the engine of this project we use two filters - ClassFilter and AttributeFilter.

But there are other filters - for example ApiTagFilter (which filters classes with the tag @api). See all filters in directory /src/Filter.

Or you can create your own custom filter:

Unignoring classes:

If classes are used as false positives, you can use our pre-filter or create your own. It helps indicate to the Hunter that the classes should be marked as unused.

For more details, see directory /src/PreFilter.

Sets for some libraries:

The Hunter contains several predefined sets for different libraries, which can be enabled with this config:

Custom cache directory:

By default, the Hunter stores its cache files in sys_get_temp_dir() . '/unused-class-hunter' (usually /tmp/unused-class-hunter). You can override this by setting the setCacheDir method:

Custom bootstrap files:

If you need to initialize something in PHP runtime before the Hunter runs (like your own autoloader), you can provide your own bootstrap files:

Strict mode

If you want the strictest rules, you can enable this:

List of them:

Output format

The Hunter supports text (by default), gitlab and github formats.

Supported PHP versions

PHP 8.2 and later.


All versions of unused-class-hunter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
nikic/php-parser Version ^5.4
symfony/console Version ^6.4 || ^7.0
symfony/finder Version ^6.4 || ^7.0
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 dbublik/unused-class-hunter contains the following files

Loading the files please wait ...