mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #1154 - parent::foo() calls should not cause exception when parent does not exist
This commit is contained in:
parent
b0534cc498
commit
0f6ce983f4
@ -232,6 +232,10 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
||||
}
|
||||
}
|
||||
|
||||
if ($storage->invalid_dependencies) {
|
||||
return;
|
||||
}
|
||||
|
||||
$class_interfaces = $storage->class_implements;
|
||||
|
||||
if (!$class->isAbstract()) {
|
||||
|
@ -308,6 +308,18 @@ class ClassTest extends TestCase
|
||||
}
|
||||
}',
|
||||
],
|
||||
'noCrashWhenIgnoringUndefinedClass' => [
|
||||
'<?php
|
||||
class A extends B {
|
||||
public function foo() {
|
||||
parent::bar();
|
||||
}
|
||||
}',
|
||||
'assertions' => [],
|
||||
'error_levels' => [
|
||||
'UndefinedClass'
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user