Skip to content

[RFC] Support optional comma in closure use list#5793

Closed
TysonAndre wants to merge 1 commit into
php:masterfrom
TysonAndre:closure_use_list
Closed

[RFC] Support optional comma in closure use list#5793
TysonAndre wants to merge 1 commit into
php:masterfrom
TysonAndre:closure_use_list

Conversation

@TysonAndre

Copy link
Copy Markdown
Contributor

@nikic nikic added this to the PHP 8.0 milestone Jul 15, 2020
@nikic

nikic commented Jul 21, 2020

Copy link
Copy Markdown
Member

Vote looks good, feel free to already land to prevent the stampede right before feature freeze.

I also sent a heads up about this at https://externals.io/message/110860#111094 so nobody complains.

@php-pulls php-pulls closed this in 4cf8b6f Jul 21, 2020
@TysonAndre

Copy link
Copy Markdown
Contributor Author

Vote looks good, feel free to already land to prevent the stampede right before feature freeze.

I also sent a heads up about this at https://externals.io/message/110860#111094 so nobody complains.

The release manager has agreed to allow merging of RFCs that have near-unanimous
votes. If an RFC ends up not achieving the required 2/3 majority at the time the
announced voting period closes, this implementation commit will be reverted
in time for the feature freeze.

At the time of writing, there were 46 Yes votes and 0 No votes.

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
@TysonAndre TysonAndre deleted the closure_use_list branch October 22, 2020 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants