User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:coding_guidelines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mantisbt:coding_guidelines [2014/09/16 05:07] – Added line length dregadmantisbt:coding_guidelines [2018/04/03 05:50] (current) – [Coding Guidelines] fix broken link to mailing lists page (#24212) dregad
Line 8: Line 8:
 The rest of this page describes in which ways we differ, as well as other Mantis-specific guidelines. The rest of this page describes in which ways we differ, as well as other Mantis-specific guidelines.
  
-Please discuss any omissions or disagreements on the [[http://mantisbt.org/mailinglists.php|Developers Mailing List]].+Please discuss any omissions or disagreements on our [[https://gitter.im/mantisbt/mantisbt|Gitter]] chat room, or in the [[http://mantisbt.org/forums|Forums]].
  
  
Line 88: Line 88:
  
 ==== Switch statements ==== ==== Switch statements ====
 +
 +Every case //must// have a ''break'' or another kind of exit statement, e.g. ''return'', ''die'', etc. If falling through to the following case is intended, it must be documented, unless the case does not contain any code. The ''break'' is not necessary for the final, default case.
  
 <code php> <code php>
Line 96: Line 98:
     case 2:     case 2:
         blah;         blah;
-        # Fall through should be commented +        # Fall through must be commented 
-    case 3:+    case 3:        # No need for a break here
     case 4:     case 4:
         blah;         blah;
-        break;+        return   # No need for a break here
     default:     default:
         blah;         blah;
mantisbt/coding_guidelines.1410858468.txt.gz · Last modified: 2014/09/16 05:07 by dregad

CC Attribution-Noncommercial-Share Alike 4.0 International Driven by DokuWiki