Skip to content

Conversation

fredden
Copy link
Member

@fredden fredden commented Jul 29, 2024

Description

From what we can determine, this is a typographical error / mistake. It seems that the intention here was to use the same error code for both sides of this if/else block.

This inconsistency was detected as part of reviewing a fixer conflict with the PSR12 standard and the src/Standards/Squiz/Tests/ControlStructures/ForEachLoopDeclarationUnitTest.inc test file. See #152 (comment) for full details on this conflict and #152 (comment) for a decision on how to move forward / resolve the inconsistency.

Note that we are not fixing other inconsistencies in this sniff as doing so would have little return on investment.

Suggested changelog entry

Squiz.ControlStructures.ForEachLoopDeclaration: change error code from SpacingAfterOpen to SpaceAfterOpen. The latter is an existing code and the former seems to have been a typographical error.

Related issues/external references

#152

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution Guidelines.
  • I grant the project the right to include and distribute the code under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have added tests to cover my changes.
  • I have verified that the code complies with the projects coding standards.
  • [Required for new sniffs] I have added XML documentation for the sniff.
From what we can determine, this is a typographical error / mistake. It seems that the intention here was to use the same error code for both sides of this if/else block.
Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fredden! LGTM.

@jrfnl jrfnl added this to the 3.11.0 milestone Jul 29, 2024
@jrfnl jrfnl merged commit 4625938 into PHPCSStandards:master Sep 29, 2024
@fredden fredden deleted the fixer-conflict/Squiz.ControlStructures.ForEachLoopDeclaration branch September 30, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment