diff options
author | haginaga <haginaga@unetworks.jp> | 2018-05-27 22:19:31 +0900 |
---|---|---|
committer | haginaga <haginaga@unetworks.jp> | 2018-05-27 22:21:02 +0900 |
commit | feab49428664e80c5814ec340835a0109bc90109 (patch) | |
tree | 1f192d0ac1795f22cad900622578236229410b2f /ale_linters | |
parent | 230656e67895e97b4155e2ceab2271562b2b9090 (diff) | |
download | ale-feab49428664e80c5814ec340835a0109bc90109.zip |
Fix code style issues and refactor to use ale#Var
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/php/phan.vim | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ale_linters/php/phan.vim b/ale_linters/php/phan.vim index 0e9ff908..ce5cadcb 100644 --- a/ale_linters/php/phan.vim +++ b/ale_linters/php/phan.vim @@ -9,7 +9,8 @@ let g:ale_php_phan_use_client = get(g:, 'ale_php_phan_use_client', 0) function! ale_linters#php#phan#GetExecutable(buffer) abort let l:executable = ale#Var(a:buffer, 'php_phan_executable') - if g:ale_php_phan_use_client == 1 && l:executable is# 'phan' + + if ale#Var(a:buffer, 'php_phan_use_client') == 1 && l:executable is# 'phan' let l:executable = 'phan_client' endif @@ -17,7 +18,7 @@ function! ale_linters#php#phan#GetExecutable(buffer) abort endfunction function! ale_linters#php#phan#GetCommand(buffer) abort - if g:ale_php_phan_use_client == 1 + if ale#Var(a:buffer, 'php_phan_use_client') == 1 let l:args = '-l ' \ . ' %s' else @@ -33,7 +34,7 @@ endfunction function! ale_linters#php#phan#Handle(buffer, lines) abort " Matches against lines like the following: - if g:ale_php_phan_use_client == 1 + if ale#Var(a:buffer, 'php_phan_use_client') == 1 " Phan error: ERRORTYPE: message in /path/to/some-filename.php on line nnn let l:pattern = '^Phan error: \(\w\+\): \(.\+\) in \(.\+\) on line \(\d\+\)$' else @@ -42,8 +43,9 @@ function! ale_linters#php#phan#Handle(buffer, lines) abort endif let l:output = [] + for l:match in ale#util#GetMatches(a:lines, l:pattern) - if g:ale_php_phan_use_client == 1 + if ale#Var('php_phan_use_client') == 1 let l:dict = { \ 'lnum': l:match[4] + 0, \ 'text': l:match[2], |