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

Check for empty values properly

Ref #647
This commit is contained in:
Matt Brown 2018-04-05 14:28:33 -04:00
parent 6d572096d6
commit e97750c761

View File

@ -157,7 +157,11 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
throw $e; throw $e;
} }
$declaring_method_id = (string) $codebase->methods->getDeclaringMethodId($method_id); $declaring_method_id = $codebase->methods->getDeclaringMethodId($method_id);
if (!$declaring_method_id) {
throw $e;
}
// happens for fake constructors // happens for fake constructors
$storage = $codebase->methods->getStorage($declaring_method_id); $storage = $codebase->methods->getStorage($declaring_method_id);