Skip to content

Latest commit

 

History

History
270 lines (95 loc) · 2.31 KB

ParseException.md

File metadata and controls

270 lines (95 loc) · 2.31 KB

ParseException

Exception class thrown when an error occurs during parsing.

Properties

parsedFile

private ?string $parsedFile

parsedLine

private int $parsedLine

snippet

private ?string $snippet

rawMessage

private string $rawMessage

Methods

__construct

public __construct(string $message, int $parsedLine = -1, string|null $snippet = null, string|null $parsedFile = null, \Throwable $previous = null): mixed

Parameters:

Parameter Type Description
$message string The error message
$parsedLine int The line where the error occurred
$snippet string|null The snippet of code near the problem
$parsedFile string|null The file name where the error occurred
$previous \Throwable

getSnippet

Gets the snippet of code near the error.

public getSnippet(): string

setSnippet

Sets the snippet of code near the error.

public setSnippet(string $snippet): mixed

Parameters:

Parameter Type Description
$snippet string

getParsedFile

Gets the filename where the error occurred.

public getParsedFile(): string

This method returns null if a string is parsed.


setParsedFile

Sets the filename where the error occurred.

public setParsedFile(string $parsedFile): mixed

Parameters:

Parameter Type Description
$parsedFile string

getParsedLine

Gets the line where the error occurred.

public getParsedLine(): int

setParsedLine

Sets the line where the error occurred.

public setParsedLine(int $parsedLine): mixed

Parameters:

Parameter Type Description
$parsedLine int

updateRepr

private updateRepr(): mixed