Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sniffs handling function calls to allow for trailing commas after parameters #1363

Closed
jrfnl opened this issue May 26, 2018 · 2 comments

Comments

@jrfnl
Copy link
Member

jrfnl commented May 26, 2018

As of PHP 7.3, trailing commas are allowed after the last parameter in a function call + in the language constructs isset() and unset().

Unit tests for this should be added to the existing sniffs which examine (and fix) function calls and the sniffs will need to be reviewed to see if they handle this correctly and if not, adjusted.

Ref: https://wiki.php.net/rfc/trailing-comma-function-calls

N.B.: A sister-issue has been opened upstream for the same in upstream sniffs: squizlabs/PHP_CodeSniffer#2030

@jrfnl jrfnl added this to the 3.0.0 milestone Dec 9, 2022
@jrfnl
Copy link
Member Author

jrfnl commented Dec 9, 2022

The PHPCSUtils PassedParameters class handles this correctly, but it would still be good to add some tests in various sniffs with function calls with trailing commas.

@jrfnl
Copy link
Member Author

jrfnl commented Aug 18, 2023

All sniffs have been reviewed and fixed to support modern PHP in as far as my imagination reached.

If any more situations would be discovered which need to be taken into account, a new issue should be opened with code samples etc.

Closing this now as fixed.

@jrfnl jrfnl closed this as completed Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant