Differences

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

Link to this comparison view

Both sides previous revision Previous revision
en:entwickler:programmierrichtlinien [2017/03/18 11:39] – [SVN Requirements] fasseen:entwickler:programmierrichtlinien [2021/11/15 14:28] (current) fasse
Line 27: Line 27:
   * while   * while
   * switch   * switch
-It should be ensured that the braces are always at the height of the associated control structure in a separate line!+The open parenthesis is set after the control structure with a space between. The closing parenthesis is always set at the height of the control structure.
  
 Here is an example of a nested if statement: Here is an example of a nested if statement:
-<code php>if ((condition1) && (condition2)) +<code php>if ((condition1) && (condition2)) {
-{+
     action1;     action1;
-    if (condition3) +    if (condition3) {
-    {+
         action2;         action2;
     }     }
-} +} elseif ((condition4) or (condition5)) {
-elseif ((condition4) or (condition5)) +
-{+
     action3;     action3;
     action4;     action4;
-} +} else {
-else +
-{+
     defaultaction;     defaultaction;
 }</code> }</code>
Line 53: Line 47:
  
 Here is an example of a switch / case statement: Here is an example of a switch / case statement:
-<code php>switch (condition) +<code php>switch (condition) {
-{+
     case 1:     case 1:
         action1;         action1;
  • en/entwickler/programmierrichtlinien.1489833578.txt.gz
  • Last modified: 2017/03/18 11:39
  • by fasse