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