Methods |
public
|
__construct(
string $text,
int $startLine = -1,
int $startFilePos = -1,
int $startTokenPos = -1,
int $endLine = -1,
int $endFilePos = -1,
int $endTokenPos = -1,
)
Constructs a comment node.
Constructs a comment node.
Parameters
$text |
Comment text (including comment delimiters like /*)
|
$startLine |
Line number the comment started on
|
$startFilePos |
File offset the comment started on
|
$startTokenPos |
Token offset the comment started on
|
|
#
|
public
|
getText(): string
Returns
The comment text (including comment delimiters like /*)
|
#
|
public
|
getStartLine(): int
Gets the line number the comment started on.
Gets the line number the comment started on.
Returns
Line number (or -1 if not available)
|
#
|
public
|
getStartFilePos(): int
Gets the file offset the comment started on.
Gets the file offset the comment started on.
Returns
File offset (or -1 if not available)
|
#
|
public
|
getStartTokenPos(): int
Gets the token offset the comment started on.
Gets the token offset the comment started on.
Returns
Token offset (or -1 if not available)
|
#
|
public
|
getEndLine(): int
Gets the line number the comment ends on.
Gets the line number the comment ends on.
Returns
Line number (or -1 if not available)
|
#
|
public
|
getEndFilePos(): int
Gets the file offset the comment ends on.
Gets the file offset the comment ends on.
Returns
File offset (or -1 if not available)
|
#
|
public
|
getEndTokenPos(): int
Gets the token offset the comment ends on.
Gets the token offset the comment ends on.
Returns
Token offset (or -1 if not available)
|
#
|
public
|
getLine(): int
Gets the line number the comment started on.
Gets the line number the comment started on.
Deprecated
Use getStartLine() instead
Returns
|
#
|
public
|
getFilePos(): int
Gets the file offset the comment started on.
Gets the file offset the comment started on.
Deprecated
Use getStartFilePos() instead
Returns
|
#
|
public
|
getTokenPos(): int
Gets the token offset the comment started on.
Gets the token offset the comment started on.
Deprecated
Use getStartTokenPos() instead
Returns
|
#
|
public
|
__toString(): string
Returns
The comment text (including comment delimiters like /*)
|
#
|
public
|
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.
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.
|
#
|
public
|
jsonSerialize(): array
|
#
|