tolerant-php-parser
tolerant-php-parser copied to clipboard
Add PHP static analyzers (of element types) to build checks?
Similar to #83
Motivation:
- More likely that phpdoc will remain accurate when refactoring
- Improved autocompletion and error detection in projects using tolerant-php-parser
- Detect potential bugs in new commits/PRs that may be undetected by unit tests
There are several open source PHP static analyzers, such as https://github.com/phan/phan (which I maintain) and https://github.com/vimeo/psalm
-
https://github.com/Microsoft/tolerant-php-parser/pull/176/files and https://github.com/Microsoft/tolerant-php-parser/pull/177/files were (the more obvious) issues detected using phan while I was working on a project to convert this to another AST format.
-
An example of how this may be set up is https://github.com/TysonAndre/tolerant-php-parser/commit/daa503d776b52d609fa7b5fac010b6d6316df7c3 (example output at https://travis-ci.org/TysonAndre/tolerant-php-parser/jobs/277628702) (Both phan and psalm have ways to suppress categories of issues and individual issues)