You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bin/rector process --dry-run /shared/backups/bartlett/sarif-php-converters/examples/fixtures/
Prints this output
2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[ERROR] Could not process "../../bartlett/sarif-php-converters/examples/fixtures/php_bad_2.php" file, due to:
"Syntax error, unexpected '}'". On line: 15
[ERROR] Could not process "../../bartlett/sarif-php-converters/examples/fixtures/php_bad_1.php" file, due to:
"Syntax error, unexpected T_STRING, Syntax error, unexpected '=', Invalid numeric literal, Syntax error,
unexpected T_LNUMBER, Invalid numeric literal, Syntax error, unexpected T_STRING". On line: 3
When verbose mode is enabled
For example
bin/rector process --dry-run /shared/backups/bartlett/sarif-php-converters/examples/fixtures/ -v
Prints this output
[ERROR] Could not process "/shared/backups/bartlett/sarif-php-converters/examples/fixtures/php_bad_1.php" file, due to:
"System error: "Syntax error, unexpected T_STRING, Syntax error, unexpected '=', Invalid numeric literal,
Syntax error, unexpected T_LNUMBER, Invalid numeric literal, Syntax error, unexpected T_STRING"
Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 3
[ERROR] Could not process "/shared/backups/bartlett/sarif-php-converters/examples/fixtures/php_bad_2.php" file, due to:
"System error: "Syntax error, unexpected '}'"
Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 15
When debug mode is enabled
For example
bin/rector process --dry-run /shared/backups/bartlett/sarif-php-converters/examples/fixtures/ -vvv
Bug Report
Minimal PHP Code Causing Issue
When you try to parse PHP scripts that have any parsing errors, the location in each files is wrong (always give line 94)
For Example
Expected Behaviour
Give the right line in each file where parsing error is detected !
In above example we should see line 3 and 15.
I've already a PR ready, if you're agree with such fix :
Introduces a
ParserErrors
classAnd populate it when we detect that Throwable exception is compatible
That will give following results (as expected)
When verbose mode is disabled
For example
Prints this output
When verbose mode is enabled
For example
Prints this output
When debug mode is enabled
For example
Prints this output
The text was updated successfully, but these errors were encountered: