1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Fix #3311 - don’t erroneously mark a class as undefined

As they can sometimes only be obvious once an autoloader has been registered
This commit is contained in:
Matthew Brown 2020-05-10 15:55:44 -04:00
parent 4b388a2951
commit 733da0e539
2 changed files with 9 additions and 0 deletions

View File

@ -1876,6 +1876,10 @@ class Config
}
if ($this->autoloader) {
// somee classes that we think are missing may not actually be missing
// as they might be autoloadable once we require the autoloader below
$codebase->classlikes->forgetMissingClassLikes();
// do this in a separate method so scope does not leak
$this->requireAutoloader($this->autoloader);

View File

@ -2315,6 +2315,11 @@ class ClassLikes
&& $this->existing_classlikes_lc[$fq_classlike_name_lc];
}
public function forgetMissingClassLikes() : void
{
$this->existing_classlikes_lc = \array_filter($this->existing_classlikes_lc);
}
/**
* @param string $fq_class_name
*