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

Enforce trailing commas in match-cases #39

Closed
krzysztofrewak opened this issue Nov 15, 2021 · 2 comments · Fixed by #79
Closed

Enforce trailing commas in match-cases #39

krzysztofrewak opened this issue Nov 15, 2021 · 2 comments · Fixed by #79
Assignees
Labels
enhancement New feature or request

Comments

@krzysztofrewak
Copy link
Member

Right now (even with changes from #30) match case blocks are not checked for trailing commas:

$result = match ($test) {
    1 => "a",
    2 => "b"
};

Expected behaviour would be:

$result = match ($test) {
    1 => "a",
    2 => "b",
};

As @Baakoma notices, TrailingCommaInMultilineFixer from PHP-CS-Fixer doesn't have option for these structures. One solution would be to create pull request do PHP-CS-Fixer; second - to clone current fixer and add it to our repository.

@krzysztofrewak krzysztofrewak added the enhancement New feature or request label Nov 15, 2021
@krzysztofrewak
Copy link
Member Author

krzysztofrewak commented May 8, 2022

Memo: This will be added to PHP-CS-Fixer with PHP-CS-Fixer/PHP-CS-Fixer#6376

@krzysztofrewak
Copy link
Member Author

Merged to master here: PHP-CS-Fixer/PHP-CS-Fixer#6381

Now we are just waiting for a new release.

@krzysztofrewak krzysztofrewak self-assigned this Jun 8, 2022
krzysztofrewak added a commit that referenced this issue Jul 7, 2022
krzysztofrewak added a commit that referenced this issue Jul 12, 2022
krzysztofrewak added a commit that referenced this issue Jul 12, 2022
* #39 - trailing commas for match

* #39 - trailing commas for match
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant