Skip to content

Allow empty else and elseif statements#11

Merged
janedbal merged 1 commit intomasterfrom
allow-empty-else-elseif
Jan 27, 2026
Merged

Allow empty else and elseif statements#11
janedbal merged 1 commit intomasterfrom
allow-empty-else-elseif

Conversation

@JanTvrdik
Copy link
Copy Markdown
Member

Summary

  • Adds exclusions for Generic.CodeAnalysis.EmptyStatement.DetectedElse and Generic.CodeAnalysis.EmptyStatement.DetectedElseIf
  • Empty else/elseif statements are now allowed when commented (similar to the existing behavior for empty catch statements)

Test plan

  • Run phpcs on code with empty else/elseif blocks to verify no errors are reported

Copilot AI review requested due to automatic review settings January 27, 2026 12:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR allows empty else and elseif statements in the ShipMonk coding standard when they contain comments, extending the existing behavior that already permits empty catch blocks.

Changes:

  • Added exclusions for Generic.CodeAnalysis.EmptyStatement.DetectedElse and Generic.CodeAnalysis.EmptyStatement.DetectedElseIf to the ruleset

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@janedbal janedbal merged commit 96bad8c into master Jan 27, 2026
13 checks passed
@janedbal janedbal deleted the allow-empty-else-elseif branch January 27, 2026 14: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.

3 participants