Skip to content

Commit

Permalink
Use methods directly on PhpFunctionFromParserNodeReflection instead o…
Browse files Browse the repository at this point in the history
…f `selectSingle()` in ParametersAcceptorSelector
  • Loading branch information
ondrejmirtes committed Sep 26, 2024
1 parent 7e216a2 commit 1322aaf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Reflection/ParametersAcceptorSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 1322aaf

Please sign in to comment.