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 [2013/08/14 20:08] – Fix incorrect tags dregad | mantisbt: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:// | + | 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 25: | Line 27: | ||
===== Code Blocks ===== | ===== Code Blocks ===== | ||
+ | |||
==== Braces and Parentheses ==== | ==== Braces and Parentheses ==== | ||
Line 34: | Line 37: | ||
* No space before the opening parentheses '' | * No space before the opening parentheses '' | ||
* One space after the opening '' | * One space after the opening '' | ||
+ | * Arrays elements should be referenced without spaces, e.g. '' | ||
Example:< | Example:< | ||
Line 84: | Line 88: | ||
==== Switch statements ==== | ==== Switch statements ==== | ||
+ | |||
+ | Every case //must// have a '' | ||
<code php> | <code php> | ||
Line 92: | Line 98: | ||
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; | ||
Line 181: | Line 187: | ||
* $t_result follows the same pattern as $t_query. | * $t_result follows the same pattern as $t_query. | ||
* $t_row also follows the same pattern as $t_query. | * $t_row also follows the same pattern as $t_query. | ||
+ | |||
Line 194: | Line 201: | ||
</ | </ | ||
+ | ===== CSS ===== | ||
+ | |||
+ | Tables should be wrapped a '' | ||
+ | |||
+ | <code html> | ||
+ | <div class=" | ||
+ | </ |
mantisbt/coding_guidelines.1376525338.txt.gz · Last modified: 2014/02/13 21:57 (external edit)