Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CloningVisitor.php

class CloningVisitor

Same name in this branch
  1. 11.1.x vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php \PhpParser\NodeVisitor\CloningVisitor

Hierarchy

  • class \PHPStan\PhpDocParser\Ast\AbstractNodeVisitor implements \PHPStan\PhpDocParser\Ast\NodeVisitor
    • class \PHPStan\PhpDocParser\Ast\NodeVisitor\CloningVisitor extends \PHPStan\PhpDocParser\Ast\AbstractNodeVisitor

Expanded class hierarchy of CloningVisitor

1 file declares its use of CloningVisitor
PhpDocParserHelper.php in vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php

File

vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php, line 9

Namespace

PHPStan\PhpDocParser\Ast\NodeVisitor
View source
final class CloningVisitor extends AbstractNodeVisitor {
    public function enterNode(Node $originalNode) {
        $node = clone $originalNode;
        $node->setAttribute(Attribute::ORIGINAL_NODE, $originalNode);
        return $node;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
AbstractNodeVisitor::afterTraverse public function * Called once after traversal.
*
* Return value semantics:
* * null: $nodes stays as-is
* * otherwise: $nodes is set to the return value
*
*
Overrides NodeVisitor::afterTraverse
AbstractNodeVisitor::beforeTraverse public function * Called once before traversal.
*
* Return value semantics:
* * null: $nodes stays as-is
* * otherwise: $nodes is set to the return value
*
*
Overrides NodeVisitor::beforeTraverse
AbstractNodeVisitor::leaveNode public function * Called when leaving a node.
*
* Return value semantics:
* * null
* => $node stays as-is
* * NodeTraverser::REMOVE_NODE
* => $node is removed from the parent array
* * NodeTraverser::STOP_TRAVERSAL
* …
Overrides NodeVisitor::leaveNode
CloningVisitor::enterNode public function * Called when entering a node.
*
* Return value semantics:
* * null
* => $node stays as-is
* * array (of Nodes)
* => The return value is merged into the parent array (at the position of the $node)
* *…
Overrides AbstractNodeVisitor::enterNode

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal