Add phan as a linter for php files (#1026)

Add phan for checking PHP code
This commit is contained in:
Diego Oliveira
2017-10-24 19:25:02 -02:00
committed by w0rp
parent c248885e57
commit b172cd8b17
5 changed files with 78 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
Before:
runtime ale_linters/php/phan.vim
Execute(The php static analyzer handler should parse errors from phan):
AssertEqual
\ [
\ {
\ 'lnum': 25,
\ 'type': 'W',
\ 'text': 'Return type of getValidator is undeclared type \Respect\Validation\Validator',
\ },
\ {
\ 'lnum': 66,
\ 'type': 'W',
\ 'text': 'Call to method string from undeclared class \Respect\Validation\Validator',
\ },
\ ],
\ ale_linters#php#phan#Handle(347, [
\ "example.php:25 PhanUndeclaredTypeReturnType Return type of getValidator is undeclared type \\Respect\\Validation\\Validator",
\ "example.php:66 PhanUndeclaredClassMethod Call to method string from undeclared class \\Respect\\Validation\\Validator",
\ ])
After:
call ale#linter#Reset()