Open vincentchalamon opened 1 month ago
I have a big list of features to implement in future, and "dead class analysis" is one of them. You just mentioned the easiest part of it, but the problem is more complex in general.
Unused traits are already implemented in native PHPStan. The rest will be much easier once I finalize internal structures refactoring.
Maybe I'll consider adding this easy part after my refactoring is done. Thanks.
I just realized we cannot reliably tell that some interface is unused just by checking that it is never implemented / extended in another interface because it can contain used constant. So until we implement dead constants analysis, we cannot implement this one.
I recently worked on a rule to detect unused interfaces, abstract classes and traits from the source code, highly inspired from your plugin (using collectors).
In case you might be interested, here is a shot:
I'm also wondering if I missed a use-case which could lead to an error or a false-alert. Any opinion about it?
Of course, if you're interested about it, I would be happy to contribute or help.