You are here

public function Twig_NodeTraverser::traverse in Translation template extractor 7.3

Same name and namespace in other branches
  1. 6.3 vendor/Twig/NodeTraverser.php \Twig_NodeTraverser::traverse()

Traverses a node and calls the registered visitors.

Parameters

Twig_NodeInterface $node A Twig_NodeInterface instance:

Return value

Twig_NodeInterface

File

vendor/Twig/NodeTraverser.php, line 59

Class

Twig_NodeTraverser
Twig_NodeTraverser is a node traverser.

Code

public function traverse(Twig_NodeInterface $node) {
  ksort($this->visitors);
  foreach ($this->visitors as $visitors) {
    foreach ($visitors as $visitor) {
      $node = $this
        ->traverseForVisitor($visitor, $node);
    }
  }
  return $node;
}