tomasvotruba / class-leak
Detect leaking classes
Fund package maintenance!
tomasvotruba
www.paypal.me/rectorphp
Installs: 536 135
Dependents: 37
Suggesters: 0
Security: 0
Stars: 90
Watchers: 3
Forks: 7
Open Issues: 1
Requires
- php: >=7.2
- dev-main
- 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
This package is auto-updated.
Last update: 2024-11-20 10:50:43 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"
If you want to skip classes that use a specific attribute or have methods that use a specific attribute, use --skip-attribute
:
vendor/bin/class-leak check bin src --skip-attribute "Symfony\\Component\\HttpKernel\\Attribute\\AsController"
Happy coding!