Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 66f9163

Browse files
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‎

Lines changed: 3 additions & 1 deletion
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‎

Lines changed: 5 additions & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /