create(ParserFactory::PREFER_PHP7); $config = Config::getInstance(); $config->throw_exception = true; $filter = new Config\FileFilter(); $filter->addExcludeFile('somefile.php'); $filter->makeExclusive(); self::$file_filter = $filter; } public function setUp() { FileChecker::clearCache(); Config::getInstance()->setIssueHandler('PossiblyUndefinedVariable', null); } public function testUndefinedClass() { $stmts = self::$parser->parse('bar()->bat()->baz()->bam()->bas()->bee()->bet()->bes()->bis(); } } '); $file_checker = new FileChecker('somefile.php', $stmts); $file_checker->check(); } }