1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Throw exception if impossible state is reached

This commit is contained in:
Matthew Brown 2017-09-02 18:22:44 -04:00
parent 73694ab04e
commit 6531e3bfb8

View File

@ -2056,6 +2056,11 @@ class CallChecker
if (strpos($function_id, '::')) {
$declaring_method_id = MethodChecker::getDeclaringMethodId($project_checker, $function_id);
if (!$declaring_method_id) {
throw new \UnexpectedValueException('This should never happen');
}
$function_storage = MethodChecker::getStorage($project_checker, $declaring_method_id);
} else {
$function_storage = FunctionChecker::getStorage($statements_checker, $function_id);