{@inheritdoc}

@param Const_ $node
498841
public function enterNode(Node $node): Node
    {
        if (false === ($node instanceof Const_)) {
            return $node;
        }

        foreach ($node->consts as $constant) {
            /** @var Node\Const_ $constant */
            $resolvedConstantName = $this->nameResolver->resolveName(
                new Name(
                    (string) $constant->name,
                    $node->getAttributes()
                )
            )->getName();

            if (false === $this->whitelist->isSymbolWhitelisted((string) $resolvedConstantName, true)) {
                continue;
            }

            if (count($node->consts) > 1) {
                throw new UnexpectedValueException(
                    'Whitelisting a constant declared in a grouped constant statement (e.g. `const FOO = '
                    .'\'foo\', BAR = \'bar\'; is not supported. Consider breaking it down in multiple constant '
                    .'declaration statements'
                );
            }

            return new Expression(
                new FuncCall(
                    new FullyQualified('define'),
                    [
                        new Arg(
                            new String_((string) $resolvedConstantName)
                        ),
                        new Arg($constant->value),
                    ]
                )
            );
        }

        return $node;
    }
538759
private function detach($node) {
        $node->getPrevious()->setNext($node->getNext());
        $node->getNext()->setPrevious($node->getPrevious());
    }
1234562
public static function remove_node($node) {
		if (
			! \is_a($node, 'DOMElement') &&
			! \is_a($node, 'DOMNode')
		) {
			return false;
		}

		$node->parentNode->removeChild($node);

		return true;
	}
1004170
private function deleteNode( $node ) {
		$this->deleteChildren( $node );
		$parent = $node->parentNode;
		$oldnode = $parent->removeChild( $node );
	}
935515
private function replaceNode(Node $node)
    {
        //Looking for parent block call
        if (!empty($inner = $node->findNode($this->name))) {
            //This construction allows child block use parent content
            $inner->nodes = $this->nodes;
        }

        $this->nodes = $node->nodes;
    }
674923
private static function removeTreeNode(array &$config, $node)
    {
        foreach ($config as $key => &$value) {
            if ($key === $node) {
                $children = $config[$node];
                unset($config[$node]);

                return $children;
            } else {
                $result = self::removeTreeNode($value, $node);
                if ($result !== false) {
                    return $result;
                }
            }
        }

        return false;
    }
343238
protected function handleControlStructure($node) {
    $this->handleParens($node);
    $colons = $node->children(Filter::isTokenType(':'));
    foreach ($colons as $colon) {
      $this->removeSpaceBefore($colon);
    }
    if ($colons->isNotEmpty()) {
      $this->newlineBefore($node->lastChild()->previous());
    }
  }
554849
public function theJsonNodeShouldBeNull($node)
    {
        $actual = $this->getJsonNodeValue($node);
        PHPUnit::assertNull($actual, sprintf('The node value is `%s`', json_encode($actual)));
    }
1364921
protected function assertIsNodeSupported(Node $node): void
    {
        if (!$this->isNodeSupported($node)) {
            $class = ClassUtils::getShortName(static::class);
            throw new InvalidArgumentException(
                "Node [{$node::schema()->getCurie()}] not supported by [{$class}]."
            );
        }
    }
260744
public function enterNode(Node $node)
    {
        if (!$node instanceof Instanceof_) {
            return;
        }

        if (($node->expr instanceof Scalar && !$node->expr instanceof Encapsed) || $node->expr instanceof ConstFetch) {
            throw new FatalErrorException(self::EXCEPTION_MSG, 0, E_ERROR, null, $node->getLine());
        }
    }
1244070
public function mutate(Node $node)
    {
        return new Node\Stmt\Return_(
            new Node\Expr\ConstFetch(new Node\Name('null'))
        );
    }
1037768
function hashcons(node) {
  const keys = t.VISITOR_KEYS[node.type];
  if (!keys) return;

  let hash = hashcode(node);

  for (const key of keys) {
    const subNode = node[key];

    if (Array.isArray(subNode)) {
      for (const child of subNode) {
        if (child) {
          hash += hashcons(child);
        }
      }
    } else if (subNode) {
      hash += hashcons(subNode);
    }
  }

  return hash;
}
27995
public function enterNode(Node $node)
    {
        if ($node instanceof Class_ || $node instanceof Trait_) {
            $this->inClass = true;
        } elseif ($node instanceof FuncCall && !$this->inClass) {
            // We'll give any args at all (besides null) a pass.
            // Technically we should be checking whether the args are objects, but this will do for now.
            //
            // @todo switch this to actually validate args when we get context-aware code cleaner passes.
            if (!empty($node->args) && !$this->isNull($node->args[0])) {
                return;
            }

            // We'll ignore name expressions as well (things like `$foo()`)
            if (!($node->name instanceof Name)) {
                return;
            }

            $name = \strtolower($node->name);
            if (\in_array($name, ['get_class', 'get_called_class'])) {
                $msg = \sprintf('%s() called without object from outside a class', $name);
                throw new ErrorException($msg, 0, E_USER_WARNING, null, $node->getLine());
            }
        }
    }
659257
public function visitNode(Node &$node)
    {
        $element = $this->dynamic_analysis;
        $path    = $this->getWorkspacePath($node->getFullPath());
        if ($path === false) {
            return;
        }

        fprintf($this->stream, "%d %s\n", $element->getPctDead(), $path);
    }
802381
protected function applyRule(ClassNode $node)
    {
        foreach ($node->getMethods() as $method) {
            $this->checkStatements($method);
        }
    }
115727
public function insert(Node $node) : void
    {
        $node->setParent($this->scope);
        $this->scope->insert($node);
    }
550303
public function leaveNode(Node $node)
    {
        if ($node instanceof Stmt\Class_
            || $node instanceof Stmt\Interface_
            || $node instanceof Stmt\Trait_
        ) {
            if (empty($this->suffix) && !empty($this->namespaceNode)) {
                $node->name = $this->append(new Name($node->name), $this->namespaceNode);
            }
            else {
                $node->name = $node->name . $this->suffix;
            }
        } elseif ($node instanceof Name) {
            if (!$this->cancelNext) {
                return $this->appendSuffix($node);
            }
            $this->cancelNext = false;
        } elseif ($node instanceof Stmt\Use_) {
            $this->isImport = false;
        } elseif ($node instanceof Stmt\GroupUse) {
            $this->groupImport = false;
        }
    }