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 MutatingScope
  • Loading branch information
ondrejmirtes committed Sep 26, 2024
1 parent 41916ba commit 865c618
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Analyser/MutatingScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
return new MixedType();
}

$returnType = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants())->getReturnType();
$returnType = $functionReflection->getReturnType();
$generatorSendType = $returnType->getTemplateType(Generator::class, 'TSend');
if ($generatorSendType instanceof ErrorType) {
return new MixedType();
Expand Down Expand Up @@ -3134,17 +3134,16 @@ private function enterFunctionLike(
bool $preserveThis,
): self
{
$acceptor = ParametersAcceptorSelector::selectSingle($functionReflection->getVariants());
$parametersByName = [];

foreach ($acceptor->getParameters() as $parameter) {
foreach ($functionReflection->getParameters() as $parameter) {
$parametersByName[$parameter->getName()] = $parameter;
}

$expressionTypes = [];
$nativeExpressionTypes = [];
$conditionalTypes = [];
foreach ($acceptor->getParameters() as $parameter) {
foreach ($functionReflection->getParameters() as $parameter) {
$parameterType = $parameter->getType();

if ($parameterType instanceof ConditionalTypeForParameter) {
Expand Down

0 comments on commit 865c618

Please sign in to comment.