create(ParserFactory::PREFER_PHP7); } public function setUp() { $config = new TestConfig(); $config->throw_exception = true; FileChecker::clearCache(); $this->project_checker = new \Psalm\Checker\ProjectChecker(); } public function testUndefinedClass() { $stmts = self::$parser->parse('barBar()->bat()->baz()->bam()->bas()->bee()->bet()->bes()->bis(); } } '); $file_checker = new FileChecker('somefile.php', $this->project_checker, $stmts); $file_checker->visitAndCheckMethods(); } public function testExcludeIssue() { Config::getInstance()->setCustomErrorLevel('UndefinedFunction', Config::REPORT_SUPPRESS); $stmts = self::$parser->parse('project_checker, $stmts); $file_checker->visitAndCheckMethods(); } }