@@ -7,20 +7,27 @@ function! s:initVariable(var, value)
7
7
return 0
8
8
endfunction
9
9
10
- call s: initVariable (" g:php_cs_fixer_default_mapping" , 1 )
11
- call s: initVariable (" g:php_cs_fixer_php_path" , " php" )
12
- call s: initVariable (" g:php_cs_fixer_finder" , " SymfonyFinder" )
13
- call s: initVariable (" g:php_cs_fixer_level" , " all" )
14
10
call s: initVariable (" g:php_cs_fixer_path" , " ~/php-cs-fixer.phar" )
15
- call s: initVariable (" g:php_cs_fixer_dry_run" , 1 )
11
+ call s: initVariable (" g:php_cs_fixer_level" , " all" )
12
+ call s: initVariable (" g:php_cs_fixer_config" , " default" )
13
+ call s: initVariable (" g:php_cs_fixer_php_path" , " php" )
14
+ call s: initVariable (" g:php_cs_fixer_fixers_list" , " " )
15
+ call s: initVariable (" g:php_cs_fixer_default_mapping" , 1 )
16
+ call s: initVariable (" g:php_cs_fixer_dry_run" , 0 )
16
17
17
- let g: php_cs_fixer_command = g: php_cs_fixer_php_path .' ' .g: php_cs_fixer_path .' fix --level =' .g: php_cs_fixer_level
18
+ let g: php_cs_fixer_command = g: php_cs_fixer_php_path .' ' .g: php_cs_fixer_path .' fix --config =' .g: php_cs_fixer_config
18
19
19
20
fun ! PhpCsFixerFix (path )
20
- let command = g: php_cs_fixer_command .' ' .a: path .' ' .g: php_cs_fixer_finder
21
+ let command = g: php_cs_fixer_command .' ' .a: path
22
+
21
23
if (g: php_cs_fixer_dry_run == 1 )
22
24
let command = command .' --dry-run'
23
25
endif
26
+
27
+ if (strlen (g: php_cs_fixer_fixers_list ))
28
+ let command = command .' --fixers=' .g: php_cs_fixer_fixers_list
29
+ endif
30
+
24
31
exe ' :! echo ' .command .' && ' .command
25
32
endfun
26
33
0 commit comments