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

Squiz/EmbeddedPhp: bug fix - prevent fixer conflict #838

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Feb 20, 2025

Description

The Squiz.PHP.EmbeddedPhp sniff expects no blank lines before the PHP close tag.
This rule can, however, conflict with sniffs enforcing blank lines after a class or function.

The sniff already contains protection against this conflict, but that protection did not take potential trailing comments after the close curly, like //end class, into account.

Fixed now.

Includes test.

Suggested changelog entry

Squiz.PHP.EmbeddedPhp: no new line before close tag was incorrectly enforced when a preceding OO construct or function had a trailing comment after the close curly

Related issues/external references

Related to #152

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

The `Squiz.PHP.EmbeddedPhp` sniff expects no blank lines before the PHP close tag.
This rule can, however, conflict with sniffs enforcing blank lines after a class or function.

The sniff already contains protection against this conflict, but that protection did not take potential trailing comments after the close curly, like `//end class`, into account.

Fixed now.

Includes test.
@jrfnl jrfnl merged commit 8b7c477 into master Feb 21, 2025
59 checks passed
@jrfnl jrfnl deleted the feature/squiz-embeddedphp-another-fixer-conflict branch February 21, 2025 23:35
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