Closed manhunto closed 7 months ago
Hi, thanks for reporting, this should work :+1:
@samsonasik Hi Abdul, could you look into fixing this? :pray:
@TomasVotruba I need to understand how class-leak library is working.
@manhunto could you create reproducible repo with step by step that show the bug, thank you.
@samsonasik Sure, I will try to do it today or at the beginning of the following week ;)
Hi, @TomasVotruba thanks for creating this tool. We started using it in our company, and it found many classes that can be removed! We love it!
To the point, we found this tool has problems when a class is used in the same namespace. It marks it as unused, but in fact, a class is used.
Example:
In this example, class B is marked as unused. To fix it, I have to add
use
, but in this case it is redundant. Rule no_unused_imports in phpcs remove it.and then class-leak tool doesn't mark class
B
as unused.I haven't taken a look in codebase deeply, but I would love to introduce a fix for that, but I want to hear that it is possible/doable without refactoring a whole tool :D