This tool will check if all used (T_USE) namespaces are needed in a given PHP file.
Require with Composer
{
"require": {
"phm/namespace-analyzer": "*"
}
}git clone https://github.com/phmLabs/NamespaceAnalyzer.gitFetch Dependencies with Composer
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update --dev(make sure your php.ini settings allows creating PHAR Archives
$ php bin/compilefrom now on you can use the PHAR as follows php namespace-analyzer.phar analyze PATH/TO/CHECK
Single File
$ php bin/console analyze example/unusednamespace.phpDirectory
$ php bin/console analyze exampleTODO
