PHPackages                             tomasvotruba/class-leak - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. tomasvotruba/class-leak

ActiveLibrary[Testing &amp; Quality](/categories/testing)

tomasvotruba/class-leak
=======================

Detect leaking classes

2.1.8(2w ago)1472.0M↓20.1%720MITPHPPHP &gt;=8.4CI passing

Since Jul 17Pushed 2w ago2 watchersCompare

[ Source](https://github.com/TomasVotruba/class-leak)[ Packagist](https://packagist.org/packages/tomasvotruba/class-leak)[ Fund](https://www.paypal.me/rectorphp)[ GitHub Sponsors](https://github.com/tomasvotruba)[ RSS](/packages/tomasvotruba-class-leak/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (14)Versions (95)Used By (20)

Class Leak
==========

[](#class-leak)

[![Downloads total](https://camo.githubusercontent.com/9deb787cb9851aff30f8742f531f3a0b7feec1d77363faf27cb98d4aacbe8fed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6d6173766f74727562612f636c6173732d6c65616b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tomasvotruba/class-leak/stats)

Find leaking classes that you never use... and get rid of them.

Install
-------

[](#install)

```
composer require tomasvotruba/class-leak --dev
```

Usage
-----

[](#usage)

Pass directories you want to check:

```
vendor/bin/class-leak check src
```

Make sure to exclude `/tests` directories, to keep reporting classes that are used in tests, but never used in the code-base.

Many types are excluded by default, as they're collected by framework magic, e.g. console command classes.

Exclude what you use
--------------------

[](#exclude-what-you-use)

Do you want to skip classes of certain type?

```
vendor/bin/class-leak check src --skip-type="App\\Contract\\SomeInterface"
```

What if your classes do no implement any type?

```
vendor/bin/class-leak check src --skip-suffix="Controller"
```

Do you want to skip classes using a specific attribute?

```
vendor/bin/class-leak check src --skip-attribute="App\\Attribute\\AsController"
```

Happy coding!

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance97

Actively maintained with recent releases

Popularity57

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 85.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~6 days

Total

92

Last Release

14d ago

Major Versions

0.2.16 → 1.0.02024-10-01

1.2.7 → 2.0.02024-12-12

PHP version history (3 changes)0.0.1PHP &gt;=8.1

0.0.6.72PHP &gt;=7.2

2.1.5PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/924196?v=4)[Tomas Votruba](/maintainers/TomasVotruba)[@TomasVotruba](https://github.com/TomasVotruba)

---

Top Contributors

[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (185 commits)")[![ruudk](https://avatars.githubusercontent.com/u/104180?v=4)](https://github.com/ruudk "ruudk (14 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (14 commits)")[![Bellangelo](https://avatars.githubusercontent.com/u/9512427?v=4)](https://github.com/Bellangelo "Bellangelo (1 commits)")[![zairigimad](https://avatars.githubusercontent.com/u/9056839?v=4)](https://github.com/zairigimad "zairigimad (1 commits)")[![erjanmx](https://avatars.githubusercontent.com/u/4899432?v=4)](https://github.com/erjanmx "erjanmx (1 commits)")[![qroques](https://avatars.githubusercontent.com/u/22145593?v=4)](https://github.com/qroques "qroques (1 commits)")

---

Tags

dead-codephpstatic-analysisunused-classes

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tomasvotruba-class-leak/health.svg)

```
[![Health](https://phpackages.com/badges/tomasvotruba-class-leak/health.svg)](https://phpackages.com/packages/tomasvotruba-class-leak)
```

###  Alternatives

[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k28.9M2.4k](/packages/infection-infection)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9224.3M28](/packages/phparkitect-phparkitect)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2603.2M436](/packages/ssch-typo3-rector)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5275.9M121](/packages/symplify-monorepo-builder)[symplify/phpstan-rules

Set of Symplify rules, type extensions and error formatter for PHPStan

26812.7M336](/packages/symplify-phpstan-rules)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
