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().
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($node)
|
#
|
protected
|
dumpFlags($flags)
|
#
|
protected
|
dumpIncludeType($type)
|
#
|
protected
|
dumpUseType($type)
|
#
|
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
|
#
|