Arcanist offers a good abstract syntax tree parser for PHP, XHPast.
PHP conventions of Nasqueron projects and default XHPast ruleset (phutil.xhpast) are relatively similar, but some differences exist:
Rule | Description of a sample error | Our convention |
XHP9 | Follow naming conventions: parameters should be named using lowercase_with_underscores. | Parameters are in camel case |
XHP38 | Declaration Formatting Convention: no spaces before opening parenthesis in function and method declarations. | We use such space at declaration, not on call |
XHP44 | Concatenation Spacing - no spaces around string concatenation operator. | We use spaces around any operator |
XHP45 | PHP Compatibility - This codebase targets PHP 5.2.3, but static:: was not introduced until PHP 5.3. | We target PHP 5.5+ |
Other suggested static analyzer implementation
See also T1063 for phan support.