final class ParserException
    extends RuntimeException
Public API: explicitly declared with @visibility public.

A source could not be parsed using the requested PHP grammar.

Inspecting the failing sourcedoctest
(new \Deriver\Exception\ParserException('Unexpected token', 'app.php', 3))->path // => 'app.php'

Properties§

public string $path
public int $sourceLine = 1

Methods§

public function __construct(
    string $message,
    public string $path,
    public int $sourceLine = 1,
    Throwable|null $previous = null,
)

Parameters

$messagestringParser diagnostic
$pathstringPath of the source being parsed
$sourceLineintOne-based line in that source
$previousThrowable|nullOriginal parser error
Calls 1
  • static-call RuntimeException::__construct() line 26

Test cases 182§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 181

Relations§

Instantiated in 1