mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #532 - register anonymous classes declared in file too
This commit is contained in:
parent
d10212b393
commit
ec74b82587
@ -154,10 +154,12 @@ class DependencyFinderVisitor extends PhpParser\NodeVisitorAbstract implements P
|
||||
$fq_classlike_name = ClassChecker::getAnonymousClassName($node, $this->file_path);
|
||||
} else {
|
||||
$fq_classlike_name = ($this->aliases->namespace ? $this->aliases->namespace . '\\' : '') . $node->name;
|
||||
$fq_classlike_name_lc = strtolower($fq_classlike_name);
|
||||
$this->file_storage->classlikes_in_file[$fq_classlike_name_lc] = $fq_classlike_name;
|
||||
}
|
||||
|
||||
$fq_classlike_name_lc = strtolower($fq_classlike_name);
|
||||
|
||||
$this->file_storage->classlikes_in_file[$fq_classlike_name_lc] = $fq_classlike_name;
|
||||
|
||||
$this->fq_classlike_names[] = $fq_classlike_name;
|
||||
|
||||
$storage = $this->codebase->createClassLikeStorage($fq_classlike_name);
|
||||
|
15
src/matt.php
Normal file
15
src/matt.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace Matt;
|
||||
|
||||
interface I {}
|
||||
|
||||
class C
|
||||
{
|
||||
public function getI(): I
|
||||
{
|
||||
return new class implements I
|
||||
{
|
||||
|
||||
};
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user