Methods |
public
|
__construct(string $message, array|int $attributes = [])
Creates an Exception signifying a parse error.
Creates an Exception signifying a parse error.
Parameters
$message |
Error message
|
$attributes |
Attributes of node/token where error occurred
(or start line of error -- deprecated)
|
|
#
|
public
|
getRawMessage(): string
Gets the error message
|
#
|
public
|
getStartLine(): int
Gets the line the error starts in.
Gets the line the error starts in.
Returns
|
#
|
public
|
getEndLine(): int
Gets the line the error ends in.
Gets the line the error ends in.
Returns
|
#
|
public
|
getAttributes(): array
Gets the attributes of the node/token the error occurred at.
Gets the attributes of the node/token the error occurred at.
|
#
|
public
|
setAttributes(array $attributes)
Sets the attributes of the node/token the error occurred at.
Sets the attributes of the node/token the error occurred at.
|
#
|
public
|
setRawMessage(string $message)
Sets the line of the PHP file the error occurred in.
Sets the line of the PHP file the error occurred in.
Parameters
|
#
|
public
|
setStartLine(int $line)
Sets the line the error starts in.
Sets the line the error starts in.
Parameters
|
#
|
public
|
hasColumnInfo(): bool
Returns whether the error has start and end column information.
Returns whether the error has start and end column information.
For column information enable the startFilePos and endFilePos in the lexer options.
|
#
|
public
|
getStartColumn(string $code): int
Gets the start column (1-based) into the line where the error started.
Gets the start column (1-based) into the line where the error started.
Parameters
$code |
Source code of the file
|
|
#
|
public
|
getEndColumn(string $code): int
Gets the end column (1-based) into the line where the error ended.
Gets the end column (1-based) into the line where the error ended.
Parameters
$code |
Source code of the file
|
|
#
|
public
|
getMessageWithColumnInfo(string $code): string
Formats message including line and column information.
Formats message including line and column information.
Parameters
$code |
Source code associated with the error, for calculation of the columns
|
Returns
|
#
|
protected
|
updateMessage()
Updates the exception message after a change to rawMessage or rawLine.
Updates the exception message after a change to rawMessage or rawLine.
|
#
|