function Node::traverse
Traverses the current node and all its child nodes using the given function
Parameters
callable $fn Function that will be called on each node:
array $options Options array. See Traverser class: documentation for available options
Return value
$this
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Node/ Node.php, line 171
Class
- Node
- Base class for all the nodes generated by Peast.
Namespace
Peast\Syntax\NodeCode
public function traverse(callable $fn, $options = array()) {
$traverser = new \Peast\Traverser($options);
$traverser->addFunction($fn)
->traverse($this);
return $this;
}