mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 19:00:49 +00:00
23 lines
579 B
PHP
23 lines
579 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Rector\Rector;
|
|
|
|
use PhpParser\Node;
|
|
use PhpParser\NodeTraverser;
|
|
use PhpParser\NodeVisitorAbstract;
|
|
use Rector\Contract\Deprecation\DeprecationInterface;
|
|
use Rector\Contract\Rector\RectorInterface;
|
|
|
|
abstract class AbstractRector extends NodeVisitorAbstract implements DeprecationInterface, RectorInterface
|
|
{
|
|
public function enterNode(Node $node): ?int
|
|
{
|
|
if ($this->isCandidate($node)) {
|
|
$this->refactor($node);
|
|
return NodeTraverser::DONT_TRAVERSE_CHILDREN;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|