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

Fix erroneous self-check

This commit is contained in:
Matthew Brown 2016-12-10 15:08:38 -05:00
parent c3df70e634
commit 327e3150a2

View File

@ -965,7 +965,13 @@ class ExpressionChecker
); );
} }
if ($return_type->value === 'static' || !$method_id) {
$return_type->value = $calling_class; $return_type->value = $calling_class;
} else {
$declaring_method_id = MethodChecker::getDeclaringMethodId($method_id);
$return_type->value = explode('::', (string)$declaring_method_id)[0];
}
} elseif ($return_type->value[0] === '$' && $method_id) { } elseif ($return_type->value[0] === '$' && $method_id) {
$method_params = MethodChecker::getMethodParams($method_id); $method_params = MethodChecker::getMethodParams($method_id);