Methods |
public
|
__construct(string $message, array<string, mixed> $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
|
|
#
|
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<string, mixed>
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<string, mixed> $attributes): void
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): void
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): void
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(): void
Updates the exception message after a change to rawMessage or rawLine.
Updates the exception message after a change to rawMessage or rawLine.
|
#
|