Skip to content

Commit 66f9163

Browse files
committed
Fix deprecation of ParametersAcceptorSelector::selectSingle()
1 parent 534ee63 commit 66f9163

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Rules/Functions/FactoriesFunctionArgumentTypeRule.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ public function processNode(Node $node, Scope $scope): array
9090

9191
$returnType = $this->factoriesReturnTypeHelper->check($nameType, $function);
9292

93-
$firstParameter = ParametersAcceptorSelector::selectSingle(
93+
$firstParameter = ParametersAcceptorSelector::selectFromArgs(
94+
$scope,
95+
$node->getArgs(),
9496
$this->reflectionProvider->getFunction($nameNode, $scope)->getVariants()
9597
)->getParameters()[0];
9698

src/Type/ServicesReturnTypeHelper.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ public function check(Type $type, Scope $scope): Type
102102
return new NullType();
103103
}
104104

105-
return ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType();
105+
return ParametersAcceptorSelector::selectFromArgs(
106+
$scope,
107+
[],
108+
$methodReflection->getVariants()
109+
)->getReturnType();
106110
}
107111

108112
return new NullType();

0 commit comments

Comments
 (0)