mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-13 12:02:09 +02:00
Updated Rector to commit 70605936b150b2b589ef4fb3c1275667ff690b26
70605936b1
[Php70] Handle ArrayDimFetch on WrapVariableVariableNameInCurlyBracesRector (#6533)
This commit is contained in:
parent
c491726ec5
commit
d0c3bb9110
@ -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;
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user