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

Don’t do last-minute checks for classes

This commit is contained in:
Brown 2018-10-08 19:39:36 -04:00
parent 29e78c5df1
commit 99eb903b0d
2 changed files with 4 additions and 15 deletions

View File

@ -258,13 +258,6 @@ class ClassLikes
) )
&& !$this->classlike_storage_provider->has($fq_class_name_lc) && !$this->classlike_storage_provider->has($fq_class_name_lc)
) { ) {
if ($this->debug_output) {
echo 'Last-chance attempt to hydrate ' . $fq_class_name . "\n";
}
// attempt to load in the class
$this->scanner->queueClassLikeForScanning($fq_class_name);
$this->codebase->scanFiles();
if (!isset($this->existing_classes_lc[$fq_class_name_lc])) { if (!isset($this->existing_classes_lc[$fq_class_name_lc])) {
$this->existing_classes_lc[$fq_class_name_lc] = false; $this->existing_classes_lc[$fq_class_name_lc] = false;
@ -307,14 +300,6 @@ class ClassLikes
) )
&& !$this->classlike_storage_provider->has($fq_class_name_lc) && !$this->classlike_storage_provider->has($fq_class_name_lc)
) { ) {
if ($this->debug_output) {
echo 'Last-chance attempt to hydrate ' . $fq_class_name . "\n";
}
// attempt to load in the class
$this->scanner->queueClassLikeForScanning($fq_class_name);
$this->scanner->scanFiles($this);
if (!isset($this->existing_interfaces_lc[$fq_class_name_lc])) { if (!isset($this->existing_interfaces_lc[$fq_class_name_lc])) {
$this->existing_interfaces_lc[$fq_class_name_lc] = false; $this->existing_interfaces_lc[$fq_class_name_lc] = false;

View File

@ -376,6 +376,10 @@ class DependencyFinderVisitor extends PhpParser\NodeVisitorAbstract implements P
} elseif ($node instanceof PhpParser\Node\Expr\Assign } elseif ($node instanceof PhpParser\Node\Expr\Assign
|| $node instanceof PhpParser\Node\Expr\AssignOp || $node instanceof PhpParser\Node\Expr\AssignOp
|| $node instanceof PhpParser\Node\Expr\AssignRef || $node instanceof PhpParser\Node\Expr\AssignRef
|| $node instanceof PhpParser\Node\Stmt\For_
|| $node instanceof PhpParser\Node\Stmt\Foreach_
|| $node instanceof PhpParser\Node\Stmt\While_
|| $node instanceof PhpParser\Node\Stmt\Do_
) { ) {
if ($doc_comment = $node->getDocComment()) { if ($doc_comment = $node->getDocComment()) {
$var_comments = []; $var_comments = [];