tomasvotruba / class-leak
Detect leaking classes
2.2.4
2026-09-03 08:44 UTC
Requires
- php: >=8.4
- entropy/entropy: ^0.4.6
- nette/utils: ^4.1
- nikic/php-parser: ^5.7
- symfony/finder: ^7.4|^8.0
- webmozart/assert: ^2.0
Requires (Dev)
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^13.0
- rector/jack: ^1.0
- rector/rector: ^2.4
- symplify/easy-coding-standard: ^13.0
- symplify/phpstan-extensions: ^12
- tracy/tracy: ^2.12
Suggests
None
Provides
None
Conflicts
None
- dev-main
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.2.16
- 0.2.15
- 0.2.14
- 0.2.13
- 0.2.12
- 0.2.11
- 0.2.10
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.3
- 0.1.2.72
- 0.1.2
- 0.1.1.72
- 0.1.1
- 0.1.0.72
- 0.1.0
- 0.0.22.72
- 0.0.22
- 0.0.21.72
- 0.0.21
- 0.0.20.72
- 0.0.20
- 0.0.19.72
- 0.0.19
- 0.0.18.72
- 0.0.18
- 0.0.17.72
- 0.0.17
- 0.0.16.72
- 0.0.16
- 0.0.15.72
- 0.0.15
- 0.0.14.72
- 0.0.14
- 0.0.13.72
- 0.0.13
- 0.0.12.72
- 0.0.12
- 0.0.11.72
- 0.0.11
- 0.0.10
- 0.0.9.72
- 0.0.9
- 0.0.8.72
- 0.0.8
- 0.0.7.72
- 0.0.7
- 0.0.6.72
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-tv-revert-unused-public
- dev-tv-go-helpers-011
- dev-bump-php-parser-in-go-0.1.1
- dev-tv-go-port
- dev-tv-skip-route-attribute
- dev-tv-skip-jms-event-subscriber
- dev-tv-second-progress-bar
This package is auto-updated.
Last update: 2026-09-04 08:20:06 UTC
README
Find leaking classes that you never use... and get rid of them.
Install
composer require tomasvotruba/class-leak --dev
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
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!