Updated Rector to commit 297853b887236d6770547058d0727a228385f87d

297853b887 [TypeDeclaration] Add Static Call support on AddMethodCallBasedStrictParamTypeRector (#5960)
This commit is contained in:
Tomas Votruba 2024-06-11 09:35:49 +00:00
parent b0c2f67914
commit 66d6637cdd
2 changed files with 5 additions and 4 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '589c1e73399a17223ea93ad6a50d2abd8a68505a';
public const PACKAGE_VERSION = '297853b887236d6770547058d0727a228385f87d';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-06-11 05:19:02';
public const RELEASE_DATE = '2024-06-11 16:32:25';
/**
* @var int
*/

View File

@ -5,6 +5,7 @@ namespace Rector\PhpParser\NodeFinder;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\Type\TypeWithClassName;
@ -46,13 +47,13 @@ final class LocalMethodCallFinder
$classMethodName = $this->nodeNameResolver->getName($classMethod);
/** @var MethodCall[] $matchingMethodCalls */
$matchingMethodCalls = $this->betterNodeFinder->find($class->getMethods(), function (Node $subNode) use($className, $classMethodName) : bool {
if (!$subNode instanceof MethodCall) {
if (!$subNode instanceof MethodCall && !$subNode instanceof StaticCall) {
return \false;
}
if (!$this->nodeNameResolver->isName($subNode->name, $classMethodName)) {
return \false;
}
$callerType = $this->nodeTypeResolver->getType($subNode->var);
$callerType = $subNode instanceof MethodCall ? $this->nodeTypeResolver->getType($subNode->var) : $this->nodeTypeResolver->getType($subNode->class);
if (!$callerType instanceof TypeWithClassName) {
return \false;
}