I\'ve searched all over for something like this but I believe the word \"use\" is perhaps too common for any helpful results:
What is the easiest way to remove all un-us
It would probably depend on the way your code is set up. If your code uses namespaces like so:
namespace Foo
{
}
then you're probably fine if you just check each file individually. That still means you would have to parse the PHP code to find the use statements, and then to determine which statements are used.
The easy way is to use a tool that's already been built. I recently started using PhpStorm IDE (30 day free trail, or the early access program) and that can inform you when you have unused use
statements in a file (and you can even specify whether that should come up as warnings or errors). It would still require you to open each file though. But you could also check files you are editing, then eventually your code will be cleaner.