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

Fall back to $method_id if no defining method id found

This commit is contained in:
Matthew Brown 2018-05-12 13:19:19 -04:00
parent 313a010355
commit 759516d01f

View File

@ -506,7 +506,9 @@ class MethodCallChecker extends \Psalm\Checker\Statements\Expression\CallChecker
continue;
}
$call_map_id = strtolower((string)$codebase->methods->getDeclaringMethodId($method_id));
$call_map_id = strtolower(
$codebase->methods->getDeclaringMethodId($method_id) ?: $method_id
);
if ($method_name_lc === '__tostring') {
$return_type_candidate = Type::getString();