Skip to content

Commit e7f9338

Browse files
committed
Refactored to use VIMScript
1 parent 1f1618c commit e7f9338

File tree

2 files changed

+10
-70
lines changed

2 files changed

+10
-70
lines changed

autoload/phpstan.vim

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
function! phpstan#PHPStanAnalyse(...)
22
let paths = join(a:000, '\ ')
3-
exe "setlocal makeprg=phpstan\\ analyse\\ --no-progress\\ -l" . g:phpstan_analyse_level . "\\ " . paths
4-
" File: path/to/file.php, line: 12, error: error message
5-
setlocal efm=File%.\ %f%.\ line%.\ %l%.\ error%.\ %m
6-
setlocal efm+=%-G " Ignore empty lines
3+
let cmd = './vendor/bin/phpstan analyse --errorFormat=raw --no-progress -l' . g:phpstan_analyse_level . ' ' . paths
4+
let result = system(cmd)
75

8-
exe "silent make\ \\\|&\ " . g:phpstan_plugin_path . "/phpstan_filter"
9-
exe "cwindow"
6+
let list = []
7+
for line in split(result, "\n")
8+
let parts = split(line, ':')
9+
call add(list, { 'filename': parts[0], 'lnum': parts[1], 'text': parts[2] })
10+
endfor
11+
12+
call setqflist(list)
13+
execute ':cwindow'
1014
endfun

plugin/phpstan_filter

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)