1
0
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:
Matthew Brown 2016-10-20 14:36:15 -04:00
parent 8c23d0829a
commit 4c51e02107
3 changed files with 8 additions and 3 deletions

View File

@ -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();
}
}

View File

@ -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;
}
/**

View File

@ -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) {