[RFC] Support optional comma in closure use list by TysonAndre · Pull Request #5793 · php/php-src

@TysonAndre

jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request

Jul 30, 2020
…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 mentioned this pull request

Jul 30, 2020