From feab49428664e80c5814ec340835a0109bc90109 Mon Sep 17 00:00:00 2001 From: haginaga Date: Sun, 27 May 2018 22:19:31 +0900 Subject: [PATCH] Fix code style issues and refactor to use ale#Var --- ale_linters/php/phan.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ale_linters/php/phan.vim b/ale_linters/php/phan.vim index 0e9ff90..ce5cadc 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],