class leak
1.0.0
查找您从未使用过的泄漏课程...并摆脱它们。
composer require tomasvotruba/class-leak --dev通过您要检查的目录:
vendor/bin/class-leak check src确保排除/tests目录,以保持在测试中使用但从未在代码库中使用的报告类。
默认情况下,许多类型被排除在外,因为它们是由框架魔术(例如控制台命令类)收集的。
您想跳过某些类型的类吗?
vendor/bin/class-leak check src --skip-type= " App \ Contract \ SomeInterface "如果您的班级不实施任何类型怎么办?
vendor/bin/class-leak check src --skip-suffix= " Controller "您想使用特定属性跳过类吗?
vendor/bin/class-leak check src --skip-attribute= " App \ Attribute \ AsController "愉快的编码!