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 "愉快的編碼!