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:
parent
4b388a2951
commit
733da0e539
@ -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);
|
||||
|
||||
|
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user