Skip to content

Commit 62af9f2

Browse files
authored
fix: memory-limit option for phpstan (#4900)
This might only be a problem for newer phpstan versions (2.1.1 here). If you try to run `phpstan` the way ale will when it builds the option, you will get something like: ``` The "--memory-limit" option requires a value. ``` It wants you to use `--memory-limit=-1` instead.
1 parent 305e1c2 commit 62af9f2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ale_linters/php/phpstan.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
2222

2323
let l:memory_limit = ale#Var(a:buffer, 'php_phpstan_memory_limit')
2424
let l:memory_limit_option = !empty(l:memory_limit)
25-
\ ? ' --memory-limit ' . ale#Escape(l:memory_limit)
25+
\ ? ' --memory-limit=' . ale#Escape(l:memory_limit)
2626
\ : ''
2727

2828
let l:level = ale#Var(a:buffer, 'php_phpstan_level')

test/linter/test_phpstan.vader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Execute(Memory limit parameter is added to the command):
125125
let g:ale_php_phpstan_memory_limit = '500M'
126126

127127
AssertLinter 'phpstan',
128-
\ ale#Escape('phpstan') . ' analyze --no-progress --errorFormat json -l ' . ale#Escape('4') . ' --memory-limit ' . ale#Escape('500M') . ' %s'
128+
\ ale#Escape('phpstan') . ' analyze --no-progress --errorFormat json -l ' . ale#Escape('4') . ' --memory-limit=' . ale#Escape('500M') . ' %s'
129129

130130
Execute(Directory is changed to that of the configuration file):
131131
call writefile([], '../phpstan.neon')

0 commit comments

Comments
 (0)