diff --git a/src/Psalm/Internal/Analyzer/ClassAnalyzer.php b/src/Psalm/Internal/Analyzer/ClassAnalyzer.php index e920468f1..0f1d9978f 100644 --- a/src/Psalm/Internal/Analyzer/ClassAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ClassAnalyzer.php @@ -232,6 +232,10 @@ class ClassAnalyzer extends ClassLikeAnalyzer } } + if ($storage->invalid_dependencies) { + return; + } + $class_interfaces = $storage->class_implements; if (!$class->isAbstract()) { diff --git a/tests/ClassTest.php b/tests/ClassTest.php index 34d500005..8e85290c2 100644 --- a/tests/ClassTest.php +++ b/tests/ClassTest.php @@ -308,6 +308,18 @@ class ClassTest extends TestCase } }', ], + 'noCrashWhenIgnoringUndefinedClass' => [ + ' [], + 'error_levels' => [ + 'UndefinedClass' + ], + ], ]; }