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(1mo ago)1492.2M↓15.1%720MITPHPPHP &gt;=8.4CI passing

Since Jul 17Pushed 1mo 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 2w 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

67

—

FairBetter than 99% of packages

Maintenance88

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

59d 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

136411.0k14](/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.2k30.0M2.9k](/packages/infection-infection)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2613.3M490](/packages/ssch-typo3-rector)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9244.5M32](/packages/phparkitect-phparkitect)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M778](/packages/sylius-sylius)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5266.1M138](/packages/symplify-monorepo-builder)

PHPackages © 2026

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