Exception class thrown when an error occurs during parsing.
- Full name:
\Symfony\Component\Yaml\Exception\ParseException
- Parent class:
\Symfony\Component\Yaml\Exception\RuntimeException
private ?string $parsedFile
private int $parsedLine
private ?string $snippet
private string $rawMessage
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 |
Gets the snippet of code near the error.
public getSnippet(): string
Sets the snippet of code near the error.
public setSnippet(string $snippet): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$snippet |
string |
Gets the filename where the error occurred.
public getParsedFile(): string
This method returns null if a string is parsed.
Sets the filename where the error occurred.
public setParsedFile(string $parsedFile): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$parsedFile |
string |
Gets the line where the error occurred.
public getParsedLine(): int
Sets the line where the error occurred.
public setParsedLine(int $parsedLine): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$parsedLine |
int |
private updateRepr(): mixed