18
18
use PHPStan \Analyser \Scope ;
19
19
use PHPStan \Node \Printer \NodeTypePrinter ;
20
20
use PHPStan \Php \PhpVersion ;
21
- use PHPStan \Reflection \FunctionReflection ;
22
21
use PHPStan \Reflection \ParameterReflection ;
23
22
use PHPStan \Reflection \ParameterReflectionWithPhpDocs ;
24
23
use PHPStan \Reflection \ParametersAcceptor ;
25
- use PHPStan \Reflection \ParametersAcceptorSelector ;
26
24
use PHPStan \Reflection \ParametersAcceptorWithPhpDocs ;
25
+ use PHPStan \Reflection \Php \PhpFunctionFromParserNodeReflection ;
27
26
use PHPStan \Reflection \Php \PhpMethodFromParserNodeReflection ;
28
27
use PHPStan \Reflection \ReflectionProvider ;
29
28
use PHPStan \Rules \PhpDoc \UnresolvableTypeHelper ;
@@ -65,7 +64,7 @@ public function __construct(
65
64
*/
66
65
public function checkFunction (
67
66
Function_ $ function ,
68
- FunctionReflection $ functionReflection ,
67
+ PhpFunctionFromParserNodeReflection $ functionReflection ,
69
68
string $ parameterMessage ,
70
69
string $ returnMessage ,
71
70
string $ unionTypesMessage ,
@@ -74,10 +73,8 @@ public function checkFunction(
74
73
string $ unresolvableReturnTypeMessage ,
75
74
): array
76
75
{
77
- $ parametersAcceptor = ParametersAcceptorSelector::selectSingle ($ functionReflection ->getVariants ());
78
-
79
76
return $ this ->checkParametersAcceptor (
80
- $ parametersAcceptor ,
77
+ $ functionReflection ,
81
78
$ function ,
82
79
$ parameterMessage ,
83
80
$ returnMessage ,
@@ -259,11 +256,8 @@ public function checkClassMethod(
259
256
string $ selfOutMessage ,
260
257
): array
261
258
{
262
- /** @var ParametersAcceptorWithPhpDocs $parametersAcceptor */
263
- $ parametersAcceptor = ParametersAcceptorSelector::selectSingle ($ methodReflection ->getVariants ());
264
-
265
259
$ errors = $ this ->checkParametersAcceptor (
266
- $ parametersAcceptor ,
260
+ $ methodReflection ,
267
261
$ methodNode ,
268
262
$ parameterMessage ,
269
263
$ returnMessage ,
0 commit comments