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

Grouped cases must contain a break #24

Closed
jbrooksuk opened this issue Aug 28, 2014 · 4 comments
Closed

Grouped cases must contain a break #24

jbrooksuk opened this issue Aug 28, 2014 · 4 comments
Labels

Comments

@jbrooksuk
Copy link
Contributor

When a select or switch has multiple cases that join together:

case T_COMMENT:
case T_ML_COMMENT:
case T_DOC_COMMENT:
    $this->_processComment($token);
    break;

The The case statement must contain a break. warning is being returned. We need to add a check on the case token that it's not immediately followed by another case.

@jbrooksuk jbrooksuk added the bug label Aug 28, 2014
@jbrooksuk
Copy link
Contributor Author

For the checks within PHPCheckstyle, I've just put @SuppressWarnings where needed.

@jbrooksuk
Copy link
Contributor Author

From my brief look through the switch handling, I'm pretty sure that PHPCheckstyle.php is already accounting for this, but it's just not working? Is this correct @tchule?

@tchule
Copy link
Contributor

tchule commented Sep 2, 2014

I don't remember having handled this case. We can say that a case need a break, except when it is an empty case.

@jbrooksuk
Copy link
Contributor Author

I think that's a good way of doing it, but so long as it's empty & followed by another case.

tchule pushed a commit that referenced this issue Feb 13, 2017
@tchule tchule closed this as completed Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants