diff --git a/src/Psalm/Internal/Codebase/ClassLikes.php b/src/Psalm/Internal/Codebase/ClassLikes.php index 6e6508d1ffc..53433f92648 100644 --- a/src/Psalm/Internal/Codebase/ClassLikes.php +++ b/src/Psalm/Internal/Codebase/ClassLikes.php @@ -860,10 +860,9 @@ public function consolidateAnalyzedData(Methods $methods, ?Progress $progress, b ), $classlike_storage->suppressed_issues, ); - } else { - $this->checkMethodReferences($classlike_storage, $methods); - $this->checkPropertyReferences($classlike_storage); } + $this->checkMethodReferences($classlike_storage, $methods); + $this->checkPropertyReferences($classlike_storage); } $this->findPossibleMethodParamTypes($classlike_storage); diff --git a/tests/UnusedCodeTest.php b/tests/UnusedCodeTest.php index 28ab6edf88c..609230e4235 100644 --- a/tests/UnusedCodeTest.php +++ b/tests/UnusedCodeTest.php @@ -160,7 +160,7 @@ function bar(): void{ $this->analyzeFile($file_path, new Context(), false); $this->project_analyzer->consolidateAnalyzedData(); - $this->assertSame(3, IssueBuffer::getErrorCount()); + $this->assertSame(4, IssueBuffer::getErrorCount()); $issue = IssueBuffer::getIssuesDataForFile($file_path)[2]; $this->assertSame('UnusedClass', $issue->type); $this->assertSame(10, $issue->line_from);