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

Remove sniffs requiring trailing comma #10

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

tfrommen
Copy link
Member

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

This PR removes three sniffs from the Syde-Extra standard.

What is the current behavior? (You can also link to an open issue here)

Currently, the following three Slevomat sniffs are part of the Syde-Extra standard:

  • SlevomatCodingStandard.Functions.RequireTrailingCommaInCall
  • SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse
  • SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration

These sniffs require a trailing comma in multi-line function calls, closure use declarations, and function declarations, respectively.

On PHP 7.4., such a trailing comma is invalid, though, making it harder to use PHP_CodeSniffer across PHP 7.4 and newer.

What is the new behavior (if this is a feature change)?

The above three sniffs have been removed from the Syde-Extra standard. This means that trailing are still supported/allowed, but no longer required, which allows writing code that is valid across PHP 7.4+.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No.

Other information:

@tfrommen tfrommen requested a review from Chrico as a code owner January 20, 2025 14:47
@tfrommen tfrommen merged commit 5a7ad3d into main Jan 21, 2025
17 checks passed
@tfrommen tfrommen deleted the do-not-require-trailing-comma branch January 21, 2025 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants