Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 10, 2023

Description

Recreation of upstream PR squizlabs/PHP_CodeSniffer#3846:

The PSR2.Classes.ClassDeclaration.CloseBraceAfterBody related logic checks that there is no blank line between the last content within the class and the close brace.

The fixer for this error code, however, does not take indented class declarations into account and inadvertently also removes (correct) indentation.

Fixed now. Includes unit test.

Suggested changelog entry

The PSR2.Classes.ClassDeclaration.CloseBraceAfterBody fixer will no longer remove potential indentation before the close brace.

@jrfnl jrfnl added this to the 3.8.0 milestone Nov 10, 2023
@jrfnl jrfnl force-pushed the feature/psr2-classdeclaration-fix-overzealous-fixer branch from 44173aa to bcd5868 Compare November 11, 2023 03:43
The `PSR2.Classes.ClassDeclaration.CloseBraceAfterBody` related logic checks that there is no blank line between the last content within the class and the close brace.

The fixer for this error code, however, does not take indented class declarations into account and inadvertently also removes (correct) indentation.

Fixed now. Includes unit test.
@jrfnl jrfnl force-pushed the feature/psr2-classdeclaration-fix-overzealous-fixer branch from bcd5868 to 9e19bd1 Compare December 5, 2023 13:04
@jrfnl jrfnl merged commit b1db1a8 into master Dec 5, 2023
@jrfnl jrfnl deleted the feature/psr2-classdeclaration-fix-overzealous-fixer branch December 5, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants