\PhpParserComment

Summary

Methods
Properties
Constants
__construct()
getText()
getLine()
getFilePos()
__toString()
getReformattedText()
jsonSerialize()
No public properties found
No constants found
No protected methods found
$text
$line
$filePos
N/A
getShortestWhitespacePrefixLen()
No private properties found
N/A

Properties

$text

$text : 

Type

$line

$line : 

Type

$filePos

$filePos : 

Type

Methods

__construct()

__construct(string  $text, integer  $startLine = -1, integer  $startFilePos = -1) 

Constructs a comment node.

Parameters

string $text

Comment text (including comment delimiters like /*)

integer $startLine

Line number the comment started on

integer $startFilePos

File offset the comment started on

getText()

getText() : string

Gets the comment text.

Returns

string —

The comment text (including comment delimiters like /*)

getLine()

getLine() : integer

Gets the line number the comment started on.

Returns

integer —

Line number

getFilePos()

getFilePos() : integer

Gets the file offset the comment started on.

Returns

integer —

File offset

__toString()

__toString() : string

Gets the comment text.

Returns

string —

The comment text (including comment delimiters like /*)

getReformattedText()

getReformattedText() : mixed|string

Gets the reformatted comment text.

"Reformatted" here means that we try to clean up the whitespace at the starts of the lines. This is necessary because we receive the comments without trailing whitespace on the first line, but with trailing whitespace on all subsequent lines.

Returns

mixed|string

jsonSerialize()

jsonSerialize() 

getShortestWhitespacePrefixLen()

getShortestWhitespacePrefixLen(  $str) 

Parameters

$str