Skip to content

Commit

Permalink
Added phpcbf to the available PHP formatters (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdayjr authored and sbdchd committed Sep 5, 2018
1 parent 8988987 commit c8bc4ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ that caused Neoformat to be invoked.
- PHP
- [`php_beautifier`](http://pear.php.net/package/PHP_Beautifier)
- [`php-cs-fixer`](http://cs.sensiolabs.org/)
- [`phpcbf`](https://github.com/squizlabs/PHP_CodeSniffer)
- Proto
- [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html)
- Pug (formally Jade)
Expand Down
10 changes: 9 additions & 1 deletion autoload/neoformat/formatters/php.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function! neoformat#formatters#php#enabled() abort
return ['phpbeautifier', 'phpcsfixer']
return ['phpbeautifier', 'phpcsfixer', 'phpcbf']
endfunction

function! neoformat#formatters#php#phpbeautifier() abort
Expand All @@ -15,3 +15,11 @@ function! neoformat#formatters#php#phpcsfixer() abort
\ 'replace': 1,
\ }
endfunction

function! neoformat#formatters#php#phpcbf() abort
return {
\ 'exe': 'phpcbf',
\ 'stdin': 1,
\ 'valid_exit_codes': [0,1],
\ }
endfunction
1 change: 1 addition & 0 deletions doc/neoformat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes*
- PHP
- [`php_beautifier`](http://pear.php.net/package/PHP_Beautifier)
- [`php-cs-fixer`](http://cs.sensiolabs.org/)
- [`phpcbf`](https://github.com/squizlabs/PHP_CodeSniffer)
- Proto
- [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html)
- Pug (formally Jade)
Expand Down

0 comments on commit c8bc4ec

Please sign in to comment.