PHP 8.0: new `PHPCompatibility.FunctionDeclarations.NewTrailingComma` sniff by jrfnl · Pull Request #1164 · PHPCompatibility/PHPCompatibility

@jrfnl

…a` sniff

PHP 8.0 will allow trailing comma's in parameter lists for function declarations.

> Allow a single optional trailing comma in parameter lists. This includes parameter lists for functions, methods and closures.

Refs:
* https://wiki.php.net/rfc/trailing_comma_in_parameter_list
* php/php-src@f545ee2

This new sniff detects those.

I've tested and confirmed that arrow functions are included in this change.

Includes unit tests.

@jrfnl jrfnl mentioned this pull request

Jul 11, 2020

40 tasks

wimg

wimg approved these changes Jul 18, 2020

@wimg wimg deleted the php-8.0/new-newtrailingcomma-sniff branch

July 18, 2020 22:29

@jrfnl jrfnl mentioned this pull request

Jul 30, 2020

@jrfnl jrfnl mentioned this pull request

Jan 2, 2023