From d0a9bf24f8ee2567ebba7da04f850b03f31bd316 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sun, 13 Oct 2019 09:51:25 -0400 Subject: [PATCH] Void-returning functions are going to be impure --- src/Psalm/Internal/Codebase/Functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Codebase/Functions.php b/src/Psalm/Internal/Codebase/Functions.php index e879925e4..267eb89f4 100644 --- a/src/Psalm/Internal/Codebase/Functions.php +++ b/src/Psalm/Internal/Codebase/Functions.php @@ -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; }