Skip to content

Commit

Permalink
Add file mapping to phpstan (#4685)
Browse files Browse the repository at this point in the history
* PHPStan is now working with filename-mapping

See help ale-lint-other-machines for more info about filename-mapping.

* Add two tests to show and test what is expected

* Missed this update while creating previous commit

* Simplified the update

We only needed to refactor the processing loop.
No extra test are needed.
  • Loading branch information
EdwinHuijsing authored Feb 22, 2024
1 parent 52c6146 commit f38a802
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ale_linters/php/phpstan.vim
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ function! ale_linters#php#phpstan#Handle(buffer, lines) abort
return l:output
endif

for l:err in l:res.files[expand('#' . a:buffer .':p')].messages
call add(l:output, {
\ 'lnum': l:err.line,
\ 'text': l:err.message,
\ 'type': 'E',
\})
for l:key in keys(l:res.files)
for l:err in l:res.files[l:key].messages
call add(l:output, {
\ 'lnum': l:err.line,
\ 'text': l:err.message,
\ 'type': 'E',
\})
endfor
endfor

return l:output
Expand Down

0 comments on commit f38a802

Please sign in to comment.