Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Jul 30, 2020

PHP 8.0 introduced trailing comma's in function declaration parameter lists. A sniff to detect these was added via PR #1164.

Since then, a new RFC has been voted on & accepted, to also allow trailing comma's in closure use lists.

This adds an additional check to the PHPCompatibility.FunctionDeclarations.NewTrailingComma sniff to detect trailing comma's in closure use lists.

Note: the error code for the original error message has been changed from Found to InParameterList, but as this sniff was only introduced recently and has not been released yet, this is not an BC-break.

Refs:

Related to #809

…se lists

PHP 8.0 introduced trailing comma's in function declaration parameter lists. A sniff to detect these was added via PR 1164.

Since then, a new RFC has been voted on & accepted, to also allow trailing comma's in closure use lists.

This adds an additional check to the `PHPCompatibility.FunctionDeclarations.NewTrailingComma` sniff to detect trailing comma's in closure `use` lists.

Note: the error code for the original error message has been changed from `Found` to `InParameterList`, but as this sniff was only introduced recently and has not been released yet, this is not an BC-break.

Refs:
* https://wiki.php.net/rfc/trailing_comma_in_closure_use_list
* php/php-src#5793
@jrfnl jrfnl added this to the 10.0.0 milestone Jul 30, 2020
@jrfnl jrfnl requested a review from wimg July 30, 2020 17:29
@jrfnl jrfnl changed the title PHP 8.0 | NewTrailingComma: add check for trailing comma in closure use lists PHP 8.0: NewTrailingComma: add check for trailing comma in closure use lists Jul 30, 2020
@wimg wimg merged commit 0ac6d93 into develop Aug 9, 2020
@wimg wimg deleted the PHP-8.0/newtrailingcomma-detect-in-closure-use branch August 9, 2020 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants