1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Fix #1154 - parent::foo() calls should not cause exception when parent does not exist

This commit is contained in:
Matthew Brown 2018-12-30 18:28:15 +01:00
parent b0534cc498
commit 0f6ce983f4
2 changed files with 16 additions and 0 deletions

View File

@ -232,6 +232,10 @@ class ClassAnalyzer extends ClassLikeAnalyzer
}
}
if ($storage->invalid_dependencies) {
return;
}
$class_interfaces = $storage->class_implements;
if (!$class->isAbstract()) {

View File

@ -308,6 +308,18 @@ class ClassTest extends TestCase
}
}',
],
'noCrashWhenIgnoringUndefinedClass' => [
'<?php
class A extends B {
public function foo() {
parent::bar();
}
}',
'assertions' => [],
'error_levels' => [
'UndefinedClass'
],
],
];
}