Updated Rector to commit 70605936b150b2b589ef4fb3c1275667ff690b26

70605936b1 [Php70] Handle ArrayDimFetch on WrapVariableVariableNameInCurlyBracesRector (#6533)
This commit is contained in:
Tomas Votruba 2024-12-08 03:09:14 +00:00
parent c491726ec5
commit d0c3bb9110
2 changed files with 14 additions and 4 deletions

View File

@ -4,6 +4,7 @@ declare (strict_types=1);
namespace Rector\Php70\Rector\Variable;
use PhpParser\Node;
use PhpParser\Node\Expr\ArrayDimFetch;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\Variable;
use Rector\Rector\AbstractRector;
@ -41,13 +42,22 @@ CODE_SAMPLE
*/
public function getNodeTypes() : array
{
return [Variable::class];
return [ArrayDimFetch::class, Variable::class];
}
/**
* @param Variable $node
* @param ArrayDimFetch|Variable $node
*/
public function refactor(Node $node) : ?Node
{
if ($node instanceof ArrayDimFetch) {
if (!$node->var instanceof Variable) {
return null;
}
if (\is_string($node->var->name)) {
return null;
}
return new Variable(new ArrayDimFetch($node->var->name, $node->dim));
}
$nodeName = $node->name;
if (!$nodeName instanceof PropertyFetch && !$nodeName instanceof Variable) {
return null;

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'cbc295afa61413494420d8ed1ced1ed6cbc1f87f';
public const PACKAGE_VERSION = '70605936b150b2b589ef4fb3c1275667ff690b26';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-12-08 08:42:00';
public const RELEASE_DATE = '2024-12-08 10:06:48';
/**
* @var int
*/