#28409 closed enhancement (fixed)
switch statements should be formatted consistently
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
I have been looking at a number of issues over at #27882.
There are a variety of places in core that format switch
statements differently. IMO, default
should always be at the bottom. It's more consistent, and it doesn't confuse static analysis tools (we don't have to do everything that is suggested by automated tools).
switch ( $var ) { case 1: $return = 'match'; break; default: break; }
is better than:
switch ( $var ) { default: break; case 1: $return = 'match'; break; }
Change History (4)
Note: See
TracTickets for help on using
tickets.
Almost every time is in an external library (boo) - but I did find 2 on us.