Skip to content

Commit e729668

Browse files
committed
remove NodeTraverserInterface from RectorNodeTraverser
1 parent f197a28 commit e729668

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

‎src/PhpParser/NodeTraverser/RectorNodeTraverser.php‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
use PhpParser\Node;
99
use PhpParser\Node\Expr;
1010
use PhpParser\Node\Stmt;
11-
use PhpParser\NodeTraverserInterface;
1211
use PhpParser\NodeVisitor;
1312
use Rector\Configuration\ConfigurationRuleFilter;
1413
use Rector\Contract\Rector\RectorInterface;
15-
use Rector\Exception\ShouldNotHappenException;
1614
use Rector\Rector\RectorRunner;
1715
use Rector\VersionBonding\ComposerPackageConstraintFilter;
1816
use Rector\VersionBonding\PhpVersionedFilter;
@@ -29,7 +27,7 @@
2927
* @see \Rector\Tests\PhpParser\NodeTraverser\RectorNodeTraverserTest
3028
* @internal No BC promise on this class, it might change any time.
3129
*/
32-
final class RectorNodeTraverser implements NodeTraverserInterface
30+
final class RectorNodeTraverser
3331
{
3432
/**
3533
* @var RectorInterface[]
@@ -57,16 +55,6 @@ public function __construct(
5755
) {
5856
}
5957

60-
public function addVisitor(NodeVisitor $visitor): void
61-
{
62-
throw new ShouldNotHappenException('The immutable node traverser does not support adding visitors.');
63-
}
64-
65-
public function removeVisitor(NodeVisitor $visitor): void
66-
{
67-
throw new ShouldNotHappenException('The immutable node traverser does not support removing visitors.');
68-
}
69-
7058
/**
7159
* @param Node[] $nodes
7260
* @return Node[]

0 commit comments

Comments
 (0)