mantisbt:coding_guidelines
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mantisbt:coding_guidelines [2014/06/03 05:44] – Added indication for array elements [] dregad | mantisbt:coding_guidelines [2025/01/11 10:16] (current) – [Coding Guidelines] fallback to PHP-FIG PER Coding Style 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:// | + | If something is not defined in this document, then please apply the rules in PHP-FIG' |
| + | |||
| + | Please discuss any omissions or disagreements on our [[https:// | ||
| ===== General Formatting ===== | ===== General Formatting ===== | ||
| + | * Line length: should generally be kept below **80 chars**, although it is acceptable to have lines up to 120 chars when necessary. | ||
| * Indentations: | * Indentations: | ||
| * PHP tags: always use ''<? | * PHP tags: always use ''<? | ||
| Line 86: | Line 90: | ||
| ==== Switch statements ==== | ==== Switch statements ==== | ||
| + | |||
| + | Every case //must// have a '' | ||
| <code php> | <code php> | ||
| Line 94: | Line 100: | ||
| case 2: | case 2: | ||
| blah; | blah; | ||
| - | # Fall through | + | # Fall through |
| - | case 3: | + | case 3: # No need for a break here |
| case 4: | case 4: | ||
| blah; | blah; | ||
| - | | + | |
| default: | default: | ||
| blah; | blah; | ||
mantisbt/coding_guidelines.1401788676.txt.gz · Last modified: 2014/09/16 05:07 (external edit)
