class ParseException extends RuntimeException

Exception class thrown when an error occurs during parsing.

Methods

__construct(string $message, int $parsedLine = -1, string|null $snippet = null, string|null $parsedFile = null, Exception $previous = null)

No description

string
getSnippet()

Gets the snippet of code near the error.

setSnippet(string $snippet)

Sets the snippet of code near the error.

string
getParsedFile()

Gets the filename where the error occurred.

setParsedFile(string $parsedFile)

Sets the filename where the error occurred.

int
getParsedLine()

Gets the line where the error occurred.

setParsedLine(int $parsedLine)

Sets the line where the error occurred.

Details

at line line 33
__construct(string $message, int $parsedLine = -1, string|null $snippet = null, string|null $parsedFile = null, Exception $previous = null)

Parameters

string $message The error message
int $parsedLine The line where the error occurred
string|null $snippet The snippet of code near the problem
string|null $parsedFile The file name where the error occurred
Exception $previous The previous exception

at line line 50
string getSnippet()

Gets the snippet of code near the error.

Return Value

string The snippet of code

at line line 60
setSnippet(string $snippet)

Sets the snippet of code near the error.

Parameters

string $snippet The code snippet

at line line 74
string getParsedFile()

Gets the filename where the error occurred.

This method returns null if a string is parsed.

Return Value

string The filename

at line line 84
setParsedFile(string $parsedFile)

Sets the filename where the error occurred.

Parameters

string $parsedFile The filename

at line line 96
int getParsedLine()

Gets the line where the error occurred.

Return Value

int The file line

at line line 106
setParsedLine(int $parsedLine)

Sets the line where the error occurred.

Parameters

int $parsedLine The file line