mini\Parsing\NodeList::walk() Method

public

Signature

public function walk(Closure $fn): void

Parameters

Name Type Default Description
$fn Closure required Documentation missing

Returns

void

Documentation

Walk all nodes depth-first, applying a callback to each

The callback receives each node and can return:

  • A Node to replace it
  • A string to replace it with a TextNode
  • null to keep the node unchanged

For DelimitedNode, children are walked first (depth-first), then the callback is applied to the DelimitedNode itself.

Source

src/Parsing/GenericParser.php:513-533