mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 20:23:49 +01:00
prevent circular type resolving for just added node
This commit is contained in:
parent
37a552ced7
commit
d9899e4522
@ -5,6 +5,7 @@ namespace Rector\Rector\Contrib\Nette\Application;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Identifier;
|
||||
use Rector\Node\Attribute;
|
||||
use Rector\Node\MethodCallNodeFactory;
|
||||
use Rector\Node\NodeFactory;
|
||||
use Rector\NodeAnalyzer\MethodCallAnalyzer;
|
||||
@ -54,6 +55,11 @@ final class TemplateMagicInvokeFilterCallRector extends AbstractRector
|
||||
|
||||
public function isCandidate(Node $node): bool
|
||||
{
|
||||
// skip just added calls
|
||||
if ($node->getAttribute(Attribute::ORIGINAL_NODE) === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->methodCallAnalyzer->isTypeAndMagic($node, 'Nette\Bridges\ApplicationLatte\Template');
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,11 @@ final class FormIsValidRector extends AbstractRector
|
||||
|
||||
public function isCandidate(Node $node): bool
|
||||
{
|
||||
// skip just added calls
|
||||
if ($node->getAttribute(Attribute::ORIGINAL_NODE) === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $this->methodCallAnalyzer->isTypeAndMethod(
|
||||
$node,
|
||||
'Symfony\Component\Form\Form',
|
||||
|
Loading…
x
Reference in New Issue
Block a user