tomasvotruba / class-leak
Detect leaking classes
Fund package maintenance!
tomasvotruba
www.paypal.me/rectorphp
Installs: 185 081
Dependents: 27
Suggesters: 0
Security: 0
Stars: 54
Watchers: 2
Forks: 5
Open Issues: 8
Requires
- php: >=7.2
- dev-main
- 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-add-suffix
This package is auto-updated.
Last update: 2023-11-21 01:16:00 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 bin 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. To exclude another class, e.g. your interface collector, use --skip-type
:
vendor/bin/class-leak check bin src --skip-type="App\\Contract\\SomeInterface"
What if your classes do no implement any type? Use --skip-suffix
instead:
vendor/bin/class-leak check bin src --skip-suffix "Controller"
Happy coding!