Methods |
public
|
__construct(array $options = [])
Constructs a NodeDumper.
Constructs a NodeDumper.
Supported options:
- bool dumpComments: Whether comments should be dumped.
- bool dumpPositions: Whether line/offset information should be dumped. To dump offset
information, the code needs to be passed to dump().
- bool dumpOtherAttributes: Whether non-comment, non-position attributes should be dumped.
Parameters
$options |
Options (see description)
|
|
#
|
public
|
dump(array|Node $node, string|null $code = null): string
Dumps a node or array.
Parameters
$node |
Node or array to dump
|
$code |
Code corresponding to dumped AST. This only needs to be passed if
the dumpPositions option is enabled and the dumping of node offsets
is desired.
|
Returns
|
#
|
protected
|
dumpRecursive(mixed $node, bool $indent = true): void
|
#
|
protected
|
dumpFlags(int $flags): string
|
#
|
protected
|
dumpPosition(Node $node): string|null
Dump node position, if possible.
Dump node position, if possible.
Parameters
$node |
Node for which to dump position
|
Returns
Dump of position, or null if position information not available
|
#
|