Skip to content

Commit

Permalink
add note about non-empty case bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul M. Jones committed May 18, 2012
1 parent 746dace commit 37e6ad4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions proposed/PSR-2-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 403,11 @@ keywords looks like single words.
### 5.2. `switch`, `case`

A `switch` structure looks like the following. Note the placement of
parentheses, spaces, and braces.
parentheses, spaces, and braces. The `case` statement MUST be indented once
from `switch`, and the `break` keyword (or other terminating keyword) MUST be
indented at the same level as the `case` body. There MUST be a comment such as
`// no break` when continuation or fall-through is intentional in a non-empty
`case` body.

```php
<?php
Expand All @@ -425,11 429,6 @@ switch ($expr) {
}
```

The `case` statement MUST be indented once from `switch`, and the `break`
keyword (or other terminating keyword) MUST be indented at the same level as
the `case` body. There MUST be a comment such as `// no break` when
continuation or fall-through is intentional.


### 5.3 `while`, `do while`

Expand Down

0 comments on commit 37e6ad4

Please sign in to comment.