From 1322aaf1d029c8db49c4c72742cb3d46f56be132 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Thu, 26 Sep 2024 13:41:07 +0200 Subject: [PATCH] Use methods directly on PhpFunctionFromParserNodeReflection instead of `selectSingle()` in ParametersAcceptorSelector --- src/Reflection/ParametersAcceptorSelector.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Reflection/ParametersAcceptorSelector.php b/src/Reflection/ParametersAcceptorSelector.php index 4d14c56ced..3ec43fd80f 100644 --- a/src/Reflection/ParametersAcceptorSelector.php +++ b/src/Reflection/ParametersAcceptorSelector.php @@ -266,9 +266,8 @@ public static function selectFromArgs( if ((new ObjectType(Closure::class))->isSuperTypeOf($varType)->yes()) { $inFunction = $scope->getFunction(); if ($inFunction !== null) { - $inFunctionVariant = self::selectSingle($inFunction->getVariants()); $closureThisParameters = []; - foreach ($inFunctionVariant->getParameters() as $parameter) { + foreach ($inFunction->getParameters() as $parameter) { if ($parameter->getClosureThisType() === null) { continue; } @@ -310,9 +309,8 @@ public static function selectFromArgs( $closureVarName = $args[0]->value->name; $inFunction = $scope->getFunction(); if ($inFunction !== null) { - $inFunctionVariant = self::selectSingle($inFunction->getVariants()); $closureThisParameters = []; - foreach ($inFunctionVariant->getParameters() as $parameter) { + foreach ($inFunction->getParameters() as $parameter) { if ($parameter->getClosureThisType() === null) { continue; }