Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PSR2/SwitchDeclaration: bug fix - handle try/catch/finally correctly
Add code to handle `try-catch-finally` statements correctly when determining whether a `case` needs a terminating comment. As per #3297 (comment): > * If there is a `finally` statement and the body of that contains a "terminating statement" (`return`, `break` etc), we don't need to check the body of the `try` or any of the `catch` statements as, no matter what, all execution branches are then covered by that one terminating statement. > * If there is **_no_** `finally` or if there is, but it does not contain a terminating statement, then all `try` and `catch` structures should each contain a terminating statement in the body. Includes plenty of unit tests. Fixes 3297
- Loading branch information
Showing
4 changed files
with
399 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.