mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
fix return type never for static function calls
This commit is contained in:
parent
5132de22e0
commit
eeb0c06173
@ -181,7 +181,7 @@ class ReturnTypeAnalyzer
|
||||
|
||||
$function_always_exits = $control_actions === [ScopeAnalyzer::ACTION_END];
|
||||
|
||||
$function_returns_implicitly = (bool)array_diff(
|
||||
$function_returns_implicitly = (bool) array_diff(
|
||||
$control_actions,
|
||||
[ScopeAnalyzer::ACTION_END, ScopeAnalyzer::ACTION_RETURN]
|
||||
);
|
||||
|
@ -89,7 +89,8 @@ class ReturnTypeCollector
|
||||
break;
|
||||
}
|
||||
|
||||
if ($stmt->expr instanceof PhpParser\Node\Expr\FuncCall) {
|
||||
if ($stmt->expr instanceof PhpParser\Node\Expr\FuncCall
|
||||
|| $stmt->expr instanceof PhpParser\Node\Expr\StaticCall) {
|
||||
$stmt_type = $nodes->getType($stmt->expr);
|
||||
if ($stmt_type && ($stmt_type->isNever() || $stmt_type->explicit_never)) {
|
||||
$return_types[] = Type::getNever();
|
||||
|
Loading…
Reference in New Issue
Block a user