SyntaxFinding
A native parser finding, without executing the proposal or interpreting process stderr.
SyntaxFinding::inspect()
public static function inspect(string $content): ?arrayLocation attributes the finding; only the parser and message identify its information. Null is not a compilation verdict: php -l still judges bodies without a ParseError.
Parameters
| Name | Type | Description |
|---|---|---|
| $content | string |
SyntaxFinding::shown()
public static function shown(string $content, array $finding): stringThe builder's own lines where the parser stopped, to close the refusal with (greenhouse evidence/1162). A line number alone sends a builder back to a text it no longer has in front of it — and the house, beside the refusal, tells it to repair that text with exact find and replace pairs. The line the parser names is where it gave up, which is rarely the line of the mistake: a missing semicolon is reported two lines down. So the lines before it travel too, and so does the line a bracket was opened on when the parser names one. After the gutter each line is the proposal's, byte for byte: it is what a `find` is copied from.
Parameters
| Name | Type | Description |
|---|---|---|
| $content | string | |
| $finding | array{message: string, line: int} |
SyntaxFinding::shownAt()
public static function shownAt(string $content, int $line): stringThe same lines for the check that runs after the parser, to close its refusal with. A body the parser reads can still fail to compile — a method declared twice, a void function that returns a value — and that check answered with what it printed: a line number inside a sentence, and no text. The line it names is the line of the mistake itself.
Parameters
| Name | Type | Description |
|---|---|---|
| $content | string | |
| $line | int |
SyntaxFinding::lineNamedIn()
public static function lineNamedIn(string $printed): ?intThe line a compile check names in what it printed — it closes its sentence with `on line N` — or null.
Parameters
| Name | Type | Description |
|---|---|---|
| $printed | string |