Documentation

NodeDumper
in package

Table of Contents

$code  : mixed
$dumpComments  : mixed
$dumpPositions  : mixed
__construct()  : mixed
Constructs a NodeDumper.
dump()  : string
Dumps a node or array.
dumpFlags()  : mixed
dumpIncludeType()  : mixed
dumpPosition()  : string|null
Dump node position, if possible.
dumpRecursive()  : mixed
dumpUseType()  : mixed
toColumn()  : mixed

Properties

Methods

__construct()

Constructs a NodeDumper.

public __construct([array<string|int, mixed> $options = [] ]) : mixed

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 : array<string|int, mixed> = []

Options (see description)

Return values
mixed

dump()

Dumps a node or array.

public dump(array<string|int, mixed>|Node $node[, string|null $code = null ]) : string
Parameters
$node : array<string|int, mixed>|Node

Node or array to dump

$code : string|null = null

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.

Return values
string

Dumped value

dumpFlags()

protected dumpFlags(mixed $flags) : mixed
Parameters
$flags : mixed
Return values
mixed

dumpIncludeType()

protected dumpIncludeType(mixed $type) : mixed
Parameters
$type : mixed
Return values
mixed

dumpPosition()

Dump node position, if possible.

protected dumpPosition(Node $node) : string|null
Parameters
$node : Node

Node for which to dump position

Return values
string|null

Dump of position, or null if position information not available

dumpRecursive()

protected dumpRecursive(mixed $node) : mixed
Parameters
$node : mixed
Return values
mixed

dumpUseType()

protected dumpUseType(mixed $type) : mixed
Parameters
$type : mixed
Return values
mixed

toColumn()

private toColumn(mixed $code, mixed $pos) : mixed
Parameters
$code : mixed
$pos : mixed
Return values
mixed

Search results