JakubOnderka / PHP-Parallel-Lint

This tool check syntax of PHP files faster than serial check with fancier output.
Other
647 stars 61 forks source link

Incorrect paths shown when run from root file system directory #98

Closed colinodell closed 7 years ago

colinodell commented 7 years ago

The Error::getShortFilePath method is currently implemented this way:

return str_replace(getcwd(), '', $this->filePath);

If you're currently cded into the root of the file system (/), this causes all the paths to have their slashes removed. For example, if I try linting /var/www/foo and there's an error inside /var/www/foo/bar.php, I'll get the following error:

Parse error: varwwwfoobar.php:123

This happens because getcwd() returns / and therefore it replaces every single slash in the path.

JakubOnderka commented 7 years ago

Thanks for your report, fixed in current master.