Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 26, 2024

Description

Follow up on #699

Commit 529bcba removed the unreachable default case from the switch, but even when it is not explicitly there, this still leaves an unreachable branch in the code flow.

This commit takes the previous change one step further and removes the switch completely in favour of two separate private functions which each handle one specific token.

N.B.: this commit will be easier to review while ignoring whitespace changes.

Suggested changelog entry

N/A

Follow up on #699

Commit 529bcba removed the unreachable `default` case from the `switch`, but even when it is not explicitly there, this still leaves an unreachable branch in the code flow.

This commit takes the previous change one step further and removes the `switch` completely in favour of two separate `private` functions which each handle one specific token.

N.B.: this commit will be easier to review while ignoring whitespace changes.
@jrfnl jrfnl added this to the 3.11.2 milestone Nov 26, 2024
@jrfnl jrfnl requested a review from rodrigoprimo November 26, 2024 04:40
@jrfnl jrfnl changed the title Generic//EmptyPHPStatement: reduce complexity/nesting levels Generic/EmptyPHPStatement: reduce complexity/nesting levels Nov 26, 2024
@jrfnl jrfnl merged commit 3924468 into master Nov 26, 2024
72 checks passed
@jrfnl jrfnl deleted the feature/generic-emptystatement-reduce-complexity branch November 26, 2024 16:19
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.

1 participant