mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix function checking
This commit is contained in:
parent
8c23d0829a
commit
4c51e02107
@ -207,7 +207,7 @@ class FileChecker implements StatementsSource
|
||||
$function_context = new Context($this->short_file_name, $file_context->self);
|
||||
$function_checkers[$stmt->name]->check($function_context);
|
||||
|
||||
if (!$config->excludeIssueInFile('InvalidReturnType', $this->checked_file_name)) {
|
||||
if (!$config->excludeIssueInFile('InvalidReturnType', $this->short_file_name)) {
|
||||
$function_checkers[$stmt->name]->checkReturnTypes();
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ class FunctionChecker extends FunctionLikeChecker
|
||||
}
|
||||
}
|
||||
|
||||
self::$function_return_types[$file_name][$function_id] = $return_type ?: Type::getMixed();
|
||||
self::$function_return_types[$file_name][$function_id] = $return_type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -382,7 +382,12 @@ abstract class FunctionLikeChecker implements StatementsSource
|
||||
$method_return_types = MethodChecker::getMethodReturnTypes($method_id);
|
||||
}
|
||||
else {
|
||||
$method_return_types = FunctionChecker::getFunctionReturnTypes($method_id, $this->file_name);
|
||||
try {
|
||||
$method_return_types = FunctionChecker::getFunctionReturnTypes($method_id, $this->file_name);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
$method_return_types = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$method_return_types) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user