I have many PHP files and I would like to check if all classes used in the source code exists. For example, let's suppose that we have the following code:
use MyProject\Logger;
use MyProject\Libraires\Form;
class MyClass
{
public function startup()
{
Logger::addTrace("()"); << check that class '\MyProject\Logger' class exists
parent::startup();
$this->requirePermittedIp();
$form = new Form(); // << check that class \MyProject\Libraries\Form exists
$utils = new Utils(); // << check that \Utils class exists
Logger::addTrace("(-)");
}
}
I know that I can use token_get_all()
function. I actually tried that but I think that somebody certainly solved this kind of problem.