Methods |
public
|
getType(): string
Gets the type of the node.
Gets the type of the node.
Returns
Implemented by
|
#
|
public
|
getSubNodeNames(): string[]
Gets the names of the sub nodes.
Gets the names of the sub nodes.
Returns
Implemented by
|
#
|
public
|
getLine(): int
Gets line the node started in (alias of getStartLine).
Gets line the node started in (alias of getStartLine).
Deprecated
Use getStartLine() instead
Returns
Start line (or -1 if not available)
Implemented by
|
#
|
public
|
getStartLine(): int
Gets line the node started in. Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).
Gets line the node started in. Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).
Returns
Start line (or -1 if not available)
Implemented by
|
#
|
public
|
getEndLine(): int
Gets the line the node ended in. Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).
Gets the line the node ended in. Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).
Returns
End line (or -1 if not available)
Implemented by
|
#
|
public
|
getStartTokenPos(): int
Gets the token offset of the first token that is part of this node. The offset is an index into the array returned by Lexer::getTokens(). Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).
Gets the token offset of the first token that is part of this node. The offset is an index into the array returned by Lexer::getTokens(). Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).
Returns
Token start position (or -1 if not available)
Implemented by
|
#
|
public
|
getEndTokenPos(): int
Gets the token offset of the last token that is part of this node. The offset is an index into the array returned by Lexer::getTokens(). Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).
Gets the token offset of the last token that is part of this node. The offset is an index into the array returned by Lexer::getTokens(). Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).
Returns
Token end position (or -1 if not available)
Implemented by
|
#
|
public
|
getStartFilePos(): int
Gets the file offset of the first character that is part of this node. Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).
Gets the file offset of the first character that is part of this node. Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).
Returns
File start position (or -1 if not available)
Implemented by
|
#
|
public
|
getEndFilePos(): int
Gets the file offset of the last character that is part of this node. Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).
Gets the file offset of the last character that is part of this node. Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).
Returns
File end position (or -1 if not available)
Implemented by
|
#
|
public
|
getComments(): Comment[]
Gets all comments directly preceding this node. The comments are also available through the "comments" attribute.
Gets all comments directly preceding this node. The comments are also available through the "comments" attribute.
Implemented by
|
#
|
public
|
getDocComment(): null|Doc
Gets the doc comment of the node.
Gets the doc comment of the node.
Returns
Doc comment object or null
Implemented by
|
#
|
public
|
setDocComment(Doc $docComment): void
Sets the doc comment of the node. This will either replace an existing doc comment or add it to the comments array.
Sets the doc comment of the node. This will either replace an existing doc comment or add it to the comments array.
Parameters
$docComment |
Doc comment to set
|
Implemented by
|
#
|
public
|
setAttribute(string $key, mixed $value): void
Sets an attribute on a node.
Sets an attribute on a node.
Implemented by
|
#
|
public
|
hasAttribute(string $key): bool
Returns whether an attribute exists.
Returns whether an attribute exists.
Implemented by
|
#
|
public
|
getAttribute(string $key, mixed $default = null): mixed
Returns the value of an attribute.
Returns the value of an attribute.
Implemented by
|
#
|
public
|
getAttributes(): array<string, mixed>
Returns all the attributes of this node.
Returns all the attributes of this node.
Implemented by
|
#
|
public
|
setAttributes(array<string, mixed> $attributes): void
Replaces all the attributes of this node.
Replaces all the attributes of this node.
Implemented by
|
#
|