PHP 8.2.31
Preview: CloningPhpDocNodeVisitor.php Size: 771 B
//opt/cpanel/ea-wappspector/vendor/rector/rector/src/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CloningPhpDocNodeVisitor.php

<?php

declare (strict_types=1);
namespace Rector\PhpDocParser\PhpDocParser\PhpDocNodeVisitor;

use PHPStan\PhpDocParser\Ast\Node;
use Rector\PhpDocParser\PhpDocParser\ValueObject\PhpDocAttributeKey;
/**
 * @api
 *
 * Mirrors
 * https://github.com/nikic/PHP-Parser/blob/d520bc9e1d6203c35a1ba20675b79a051c821a9e/lib/PhpParser/NodeVisitor/CloningVisitor.php
 */
final class CloningPhpDocNodeVisitor extends \Rector\PhpDocParser\PhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor
{
    public function enterNode(Node $node) : Node
    {
        $clonedNode = clone $node;
        if (!$clonedNode->hasAttribute(PhpDocAttributeKey::ORIG_NODE)) {
            $clonedNode->setAttribute(PhpDocAttributeKey::ORIG_NODE, $node);
        }
        return $clonedNode;
    }
}

Directory Contents

Dirs: 0 × Files: 4

Name Size Perms Modified Actions
849 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
921 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
771 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.21 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).