File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1010use PhpParser \Node \Stmt ;
1111use PhpParser \Node \Stmt \ClassMethod ;
1212use PhpParser \Node \Stmt \Foreach_ ;
13+ use PhpParser \NodeVisitor ;
1314use PHPStan \Type \ObjectType ;
14- use PHPStan \Type \Type ;
1515use Rector \PHPUnit \CodeQuality \NodeAnalyser \NullableObjectAssignCollector ;
1616use Rector \PHPUnit \CodeQuality \NodeFactory \AssertMethodCallFactory ;
1717use Rector \PHPUnit \CodeQuality \TypeAnalyzer \MethodCallParameterTypeResolver ;
@@ -171,7 +171,7 @@ private function matchedNullableArgumentNameToType(
171171 $ this ->traverseNodesWithCallable ($ stmt , function (Node $ node ) use (
172172 $ variableNameToTypeCollection ,
173173 &$ matchedNullableVariableNameToType
174- ) {
174+ ): ? int {
175175 if (! $ node instanceof MethodCall) {
176176 return null ;
177177 }
@@ -209,7 +209,7 @@ private function matchedNullableArgumentNameToType(
209209 return null ;
210210 }
211211
212- return \ PhpParser \ NodeVisitor::STOP_TRAVERSAL ;
212+ return NodeVisitor::STOP_TRAVERSAL ;
213213 }
214214
215215 return null ;
Original file line number Diff line number Diff line change 1111use PhpParser \Node \Stmt \ClassMethod ;
1212use PhpParser \Node \Stmt \Foreach_ ;
1313use PhpParser \NodeVisitor ;
14- use PHPStan \Type \Type ;
1514use Rector \PHPUnit \CodeQuality \NodeAnalyser \NullableObjectAssignCollector ;
1615use Rector \PHPUnit \CodeQuality \NodeFactory \AssertMethodCallFactory ;
1716use Rector \PHPUnit \CodeQuality \TypeAnalyzer \SimpleTypeAnalyzer ;
Original file line number Diff line number Diff line change 77use PhpParser \Node \Expr \MethodCall ;
88use PHPStan \Reflection \MethodReflection ;
99use PHPStan \Reflection \ParametersAcceptorSelector ;
10+ use PHPStan \Type \Type ;
1011use Rector \Reflection \ReflectionResolver ;
1112
12- final class MethodCallParameterTypeResolver
13+ final readonly class MethodCallParameterTypeResolver
1314{
1415 public function __construct (
1516 private ReflectionResolver $ reflectionResolver
1617 ) {
1718 }
1819
1920 /**
20- * @return \PHPStan\Type\ Type[]|null
21+ * @return Type[]|null
2122 */
2223 public function resolve (MethodCall $ methodCall ): ?array
2324 {
@@ -30,11 +31,11 @@ public function resolve(MethodCall $methodCall): ?array
3031 return null ;
3132 }
3233
33- $ parametersAcceptor = ParametersAcceptorSelector::combineAcceptors ($ methodReflection ->getVariants ());
34+ $ extendedParametersAcceptor = ParametersAcceptorSelector::combineAcceptors ($ methodReflection ->getVariants ());
3435
3536 $ parameterTypesByPosition = [];
36- foreach ($ parametersAcceptor ->getParameters () as $ parameterReflection ) {
37- $ parameterTypesByPosition [] = $ parameterReflection ->getType ();
37+ foreach ($ extendedParametersAcceptor ->getParameters () as $ extendedParameterReflection ) {
38+ $ parameterTypesByPosition [] = $ extendedParameterReflection ->getType ();
3839 }
3940
4041 return $ parameterTypesByPosition ;
You can’t perform that action at this time.
0 commit comments