Skip to content

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