rector/src/Rector/AbstractRector.php
2017-08-07 17:27:04 +02:00

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;
}
}