Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

[Improvement] Remove tail comma for php function declarations #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

camilledejoye
Copy link
Contributor

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 camilledejoye force-pushed the imp/php-always-tail-comma-for-method-declaration branch 2 times, most recently from 51f4287 to 668f5e7 Compare November 22, 2020 13:17
@camilledejoye camilledejoye force-pushed the imp/php-always-tail-comma-for-method-declaration branch from 668f5e7 to ac4c2b4 Compare June 19, 2021 08:48
@camilledejoye
Copy link
Contributor Author

Hi,

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

@camilledejoye camilledejoye force-pushed the imp/php-always-tail-comma-for-method-declaration branch from ac4c2b4 to d8f5573 Compare September 19, 2021 11:06
@camilledejoye camilledejoye force-pushed the imp/php-always-tail-comma-for-method-declaration branch from d8f5573 to 6b44c15 Compare September 21, 2021 15:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant