Closed strangerkir closed 1 year ago
I'm not sure this is possible at all.
PHPCS does not have cross-files knowledge, and so if a service is declared in a module, but then consumed in another module it could be impossible to detect that.
Ok, I see. I'm closing the issue. Thanks for your answer!
Is your feature request related to a problem?
A projects using Inpsyde Modularity would benefit from a sniffs detecting declared but never used services. Having with time more and more service definitions, we need an automated way of removing them.
Describe the desired solution
Add a sniff, checking for unused services.
Describe the alternatives that you have considered
Extending original sniffs detecting dead code? Would be great to help PHP_CodeSniffer to understand the container and services, then unused services probably would be detected by a regular dead code sniffer.
Additional context
No response
Code of Conduct