1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDocParser\Ast\NodeVisitor;
4:
5: use PHPStan\PhpDocParser\Ast\AbstractNodeVisitor;
6: use PHPStan\PhpDocParser\Ast\Attribute;
7: use PHPStan\PhpDocParser\Ast\Node;
8:
9: final class CloningVisitor extends AbstractNodeVisitor
10: {
11:
12: public function enterNode(Node $originalNode): Node
13: {
14: $node = clone $originalNode;
15: $node->setAttribute(Attribute::ORIGINAL_NODE, $originalNode);
16:
17: return $node;
18: }
19:
20: }
21: