mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 20:00:50 +00:00
This commit is contained in:
parent
fb8b9c1e75
commit
a65d5de82f
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector\Fixture;
|
||||
|
||||
final class SkipArrayPushNotInExpression
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$tagstack = array();
|
||||
$tag = 'a';
|
||||
$stacksize = array_push( $tagstack, $tag );
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ use PhpParser\Node\Expr\Assign;
|
|||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
|
||||
|
@ -73,6 +74,11 @@ CODE_SAMPLE
|
|||
return null;
|
||||
}
|
||||
|
||||
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
|
||||
if (! $parent instanceof Expression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$arrayDimFetch = new ArrayDimFetch($node->args[0]->value);
|
||||
|
||||
$position = 1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user