From 99eb903b0d6745cf2610c7896793b0ce7f751192 Mon Sep 17 00:00:00 2001 From: Brown Date: Mon, 8 Oct 2018 19:39:36 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20do=20last-minute=20checks=20for?= =?UTF-8?q?=20classes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Psalm/Codebase/ClassLikes.php | 15 --------------- src/Psalm/Visitor/DependencyFinderVisitor.php | 4 ++++ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Psalm/Codebase/ClassLikes.php b/src/Psalm/Codebase/ClassLikes.php index 8d33ca9dc..2290f0938 100644 --- a/src/Psalm/Codebase/ClassLikes.php +++ b/src/Psalm/Codebase/ClassLikes.php @@ -258,13 +258,6 @@ class ClassLikes ) && !$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])) { $this->existing_classes_lc[$fq_class_name_lc] = false; @@ -307,14 +300,6 @@ class ClassLikes ) && !$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])) { $this->existing_interfaces_lc[$fq_class_name_lc] = false; diff --git a/src/Psalm/Visitor/DependencyFinderVisitor.php b/src/Psalm/Visitor/DependencyFinderVisitor.php index 7054cb7fe..50ae858a6 100644 --- a/src/Psalm/Visitor/DependencyFinderVisitor.php +++ b/src/Psalm/Visitor/DependencyFinderVisitor.php @@ -376,6 +376,10 @@ class DependencyFinderVisitor extends PhpParser\NodeVisitorAbstract implements P } elseif ($node instanceof PhpParser\Node\Expr\Assign || $node instanceof PhpParser\Node\Expr\AssignOp || $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()) { $var_comments = [];