Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php declare(strict_types=1); namespace Psalm\Internal\PhpVisitor; use PhpParser\Node;..

Decoded Output download

<?php

declare(strict_types=1);

namespace Psalm\Internal\PhpVisitor;

use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;

/**
 * Visitor cloning all nodes and linking to the original nodes using an attribute.
 *
 * This visitor is required to perform format-preserving pretty prints.
 *
 * @internal
 */
final class CloningVisitor extends NodeVisitorAbstract
{
    public function enterNode(Node $node): Node
    {
        $node = clone $node;

        if (($cs = $node->getComments()) !== []) {
            $comments = [];
            foreach ($cs as $i => $comment) {
                $comments[$i] = clone $comment;
            }

            $node->setAttribute('comments', $comments);
        }

        return $node;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace Psalm\Internal\PhpVisitor;

use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;

/**
 * Visitor cloning all nodes and linking to the original nodes using an attribute.
 *
 * This visitor is required to perform format-preserving pretty prints.
 *
 * @internal
 */
final class CloningVisitor extends NodeVisitorAbstract
{
    public function enterNode(Node $node): Node
    {
        $node = clone $node;

        if (($cs = $node->getComments()) !== []) {
            $comments = [];
            foreach ($cs as $i => $comment) {
                $comments[$i] = clone $comment;
            }

            $node->setAttribute('comments', $comments);
        }

        return $node;
    }
}

Function Calls

None

Variables

None

Stats

MD5 e858d5ebb317966747541e804a098d45
Eval Count 0
Decode Time 97 ms