private $env;
private $visitors =
[];
/**
* @param NodeVisitorInterface[] $visitors
*/
public function __construct(Environment
$env, array
$visitors =
[]) { $this->env =
$env;
foreach ($visitors as $visitor) { $this->
addVisitor($visitor);
} } public function addVisitor(NodeVisitorInterface
$visitor): void
{ $this->visitors
[$visitor->
getPriority()][] =
$visitor;
} /**
* Traverses a node and calls the registered visitors.
*/