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; }