summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Zonnenberg <adriaanzon@users.noreply.github.com>2017-05-09 18:34:38 +0200
committerw0rp <devw0rp@gmail.com>2017-05-09 22:39:00 +0100
commit2503eda68bdb7ada35b6a3c049cdb5384dac0725 (patch)
tree94a8fb5dc0942b28b46f86d44e09c48e18730b45
parent8e4bac54a60ade993eba16fac74e18c2a7697bcf (diff)
downloadale-2503eda68bdb7ada35b6a3c049cdb5384dac0725.zip
Merge pull request #533 from pbogut/add_php7_compatibility
Add PHP 7 compatibility
-rw-r--r--ale_linters/php/php.vim6
-rw-r--r--test/handler/test_php_handler.vader16
2 files changed, 11 insertions, 11 deletions
diff --git a/ale_linters/php/php.vim b/ale_linters/php/php.vim
index 6d151686..7c9e8c18 100644
--- a/ale_linters/php/php.vim
+++ b/ale_linters/php/php.vim
@@ -5,7 +5,7 @@ function! ale_linters#php#php#Handle(buffer, lines) abort
" Matches patterns like the following:
"
" PHP Parse error: syntax error, unexpected ';', expecting ']' in - on line 15
- let l:pattern = '\vPHP %(Fatal|Parse) error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in - on line (\d+)'
+ let l:pattern = '\v^%(Fatal|Parse) error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in - on line (\d+)'
let l:output = []
@@ -23,7 +23,7 @@ endfunction
call ale#linter#Define('php', {
\ 'name': 'php',
\ 'executable': 'php',
-\ 'output_stream': 'both',
-\ 'command': 'php -l -d display_errors=1 --',
+\ 'output_stream': 'stdout',
+\ 'command': 'php -l -d error_reporting=E_ALL -d display_errors=1 --',
\ 'callback': 'ale_linters#php#php#Handle',
\})
diff --git a/test/handler/test_php_handler.vader b/test/handler/test_php_handler.vader
index 086a4f6a..5dac0948 100644
--- a/test/handler/test_php_handler.vader
+++ b/test/handler/test_php_handler.vader
@@ -48,14 +48,14 @@ Execute(The php handler should parse lines correctly):
\ ],
\ ale_linters#php#php#Handle(347, [
\ 'This line should be ignored completely',
- \ "Parse error: syntax error, This line should be ignored completely in - on line 1",
- \ "PHP Parse error: syntax error, unexpected ';', expecting ']' in - on line 1",
- \ "PHP Parse error: syntax error, unexpected '/', expecting function (T_FUNCTION) or const (T_CONST) in - on line 2",
- \ "PHP Parse error: syntax error, unexpected ')' in - on line 3",
- \ "PHP Parse error: syntax error, unexpected ''bar'' (T_CONSTANT_ENCAPSED_STRING), expecting ']' in - on line 4",
- \ "PHP Fatal error: Cannot redeclare count() in - on line 5",
- \ 'PHP Parse error: syntax error, unexpected end of file in - on line 21',
- \ 'PHP Parse error: Invalid numeric literal in - on line 47',
+ \ "PHP Parse error: syntax error, This line should be ignored completely in - on line 1",
+ \ "Parse error: syntax error, unexpected ';', expecting ']' in - on line 1",
+ \ "Parse error: syntax error, unexpected '/', expecting function (T_FUNCTION) or const (T_CONST) in - on line 2",
+ \ "Parse error: syntax error, unexpected ')' in - on line 3",
+ \ "Parse error: syntax error, unexpected ''bar'' (T_CONSTANT_ENCAPSED_STRING), expecting ']' in - on line 4",
+ \ "Fatal error: Cannot redeclare count() in - on line 5",
+ \ 'Parse error: syntax error, unexpected end of file in - on line 21',
+ \ 'Parse error: Invalid numeric literal in - on line 47',
\ ])
After: