diff --git a/src/Psalm/Internal/Codebase/Functions.php b/src/Psalm/Internal/Codebase/Functions.php index 4f623d63c..2588dc8ae 100644 --- a/src/Psalm/Internal/Codebase/Functions.php +++ b/src/Psalm/Internal/Codebase/Functions.php @@ -3,7 +3,7 @@ namespace Psalm\Internal\Codebase; use Exception; use PhpParser\Node\Arg; -use PhpParser\Node\Expr\Closure; +use PhpParser\Node\Expr\Closure as ClosureNode; use Psalm\Codebase; use Psalm\Internal\Analyzer\StatementsAnalyzer; use Psalm\Internal\MethodIdentifier; @@ -563,7 +563,7 @@ class Functions } $must_use = $function_id !== 'array_map' - || (isset($args[0]) && !$args[0]->value instanceof Closure); + || (isset($args[0]) && !$args[0]->value instanceof ClosureNode); foreach ($function_callable->params as $i => $param) { if ($type_provider && $param->type && $param->type->hasCallableType() && isset($args[$i])) {