\PhpParserNodeDumper

Summary

Methods
Properties
Constants
__construct()
dump()
No public properties found
No constants found
dumpRecursive()
dumpFlags()
dumpIncludeType()
dumpUseType()
dumpPosition()
No protected properties found
N/A
toColumn()
$dumpComments
$dumpPositions
$code
N/A

Properties

$dumpComments

$dumpComments : 

Type

$dumpPositions

$dumpPositions : 

Type

$code

$code : 

Type

Methods

__construct()

__construct(array  $options = array()) 

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

array $options

Options (see description)

dump()

dump(array|\PhpParser\Node  $node, string|null  $code = null) : string

Dumps a node or array.

Parameters

array|\PhpParser\Node $node

Node or array to dump

string|null $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

string —

Dumped value

dumpRecursive()

dumpRecursive(  $node) 

Parameters

$node

dumpFlags()

dumpFlags(  $flags) 

Parameters

$flags

dumpIncludeType()

dumpIncludeType(  $type) 

Parameters

$type

dumpUseType()

dumpUseType(  $type) 

Parameters

$type

dumpPosition()

dumpPosition(\PhpParser\Node  $node) 

Parameters

\PhpParser\Node $node

toColumn()

toColumn(  $code,   $pos) 

Parameters

$code
$pos