vim-argwrap icon indicating copy to clipboard operation
vim-argwrap copied to clipboard

[Improvement] Remove tail comma for php function declarations

Open camilledejoye opened this issue 5 years ago • 1 comments

Hi,

This improvement aims to handle trailing comma with functions and methods in PHP. Since PHP 7.3 trailing comma in function calls is a valid syntax. But until PHP 8 tailing comma in function declarations will still be invalid.

Argwrap already allows us to add the trailing comma with either argwrap_trailing_comma = 1 or argwrap_trailing_comma_braces = '('options. This PR adds a new option argwrap_php_remove_tail_comma_function_declaration, disabled by default, which activates a new hook that will remove the trailing comma only for function or method declarations.

The hook also handle arrow functions that were introduced in PHP 7.4.

camilledejoye avatar Nov 22 '20 13:11 camilledejoye

Hi,

I completely forgot about that ! Anyway it could be merged ?

camilledejoye avatar Sep 19 '21 10:09 camilledejoye