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

Void-returning functions are going to be impure

This commit is contained in:
Matthew Brown 2019-10-13 09:51:25 -04:00
parent a658566429
commit d0a9bf24f8

View File

@ -381,7 +381,10 @@ class Functions
$args ?: []
);
if (!$function_callable->params || ($args !== null && \count($args) === 0)) {
if (!$function_callable->params
|| ($args !== null && \count($args) === 0)
|| ($function_callable->return_type && $function_callable->return_type->isVoid())
) {
return false;
}