PHP 8.0: NewTrailingComma: add check for trailing comma in closure use lists by jrfnl · Pull Request #1190 · PHPCompatibility/PHPCompatibility

@jrfnl

…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

40 tasks

@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 approved these changes Aug 9, 2020

@wimg wimg deleted the PHP-8.0/newtrailingcomma-detect-in-closure-use branch

August 9, 2020 18:54

@jrfnl jrfnl mentioned this pull request

Jan 2, 2023