PHPackages                             dbublik/unused-class-hunter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dbublik/unused-class-hunter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dbublik/unused-class-hunter
===========================

Detects unused classes in your codebase

v1.5.1(1y ago)814[5 PRs](https://github.com/dbublik/unused-class-hunter/pulls)MITPHPPHP ^8.2CI passing

Since Feb 20Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/dbublik/unused-class-hunter)[ Packagist](https://packagist.org/packages/dbublik/unused-class-hunter)[ RSS](/packages/dbublik-unused-class-hunter/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (6)Versions (16)Used By (0)

Unused class hunter
===================

[](#unused-class-hunter)

Detects unused classes in your PHP codebase.

[![PHP Version Requirement](https://camo.githubusercontent.com/298f1a740091f42a733714690447200348ae086de050cef723011cd962bce6d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f646275626c696b2f756e757365642d636c6173732d68756e7465722f706870)](https://packagist.org/packages/dbublik/unused-class-hunter)[![License](https://camo.githubusercontent.com/b0f2f1f90b5a741ef2d2b4669fd79e35e98ed4e887f0f86a51390639df919a1e/68747470733a2f2f706f7365722e707567782e6f72672f646275626c696b2f756e757365642d636c6173732d68756e7465722f6c6963656e7365)](https://choosealicense.com/licenses/mit/)[![Tests](https://github.com/dbublik/unused-class-hunter/actions/workflows/tests.yaml/badge.svg)](https://github.com/dbublik/unused-class-hunter/actions/workflows/tests.yaml)[![Lint](https://github.com/dbublik/unused-class-hunter/actions/workflows/lint.yaml/badge.svg)](https://github.com/dbublik/unused-class-hunter/actions/workflows/lint.yaml)[![Code coverage](https://camo.githubusercontent.com/09f11133f785281c40acf47bd78e9bdaf5a6d0d599f1cffc0587a8fa1d66fe80/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f646275626c696b2f756e757365642d636c6173732d68756e7465722f62616467652e737667)](https://coveralls.io/github/dbublik/unused-class-hunter)[![Mutation score](https://camo.githubusercontent.com/8c85473e8208b58a0d3ec6770999da7b9addd6dc18894cedea36864f8ab4aa64/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246646275626c696b253246756e757365642d636c6173732d68756e7465722532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/dbublik/unused-class-hunter/main)

Installation
------------

[](#installation)

```
composer require --dev dbublik/unused-class-hunter
```

Usage
-----

[](#usage)

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

```
./vendor/bin/unused-class-hunter hunt
```

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:

```
./vendor/bin/unused-class-hunter hunt --delete
```

Customization
-------------

[](#customization)

### Config:

[](#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:

```
