create(ParserFactory::PREFER_PHP7); } /** * @return void */ public function setUp() { $config = new TestConfig(); $config->throw_exception = true; FileChecker::clearCache(); $this->project_checker = new \Psalm\Checker\ProjectChecker(); } /** * @return void */ 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->visitAndAnalyzeMethods(); } /** * @return void */ public function testExcludeIssue() { Config::getInstance()->setCustomErrorLevel('UndefinedFunction', Config::REPORT_SUPPRESS); $stmts = self::$parser->parse('project_checker, $stmts); $file_checker->visitAndAnalyzeMethods(); } }