Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
en:entwickler:programmierrichtlinien [2017/03/18 11:39] – [SVN Requirements] fasse | en: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 | + | The open parenthesis is set after the control structure with a space between. The closing parenthesis is always |
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; | ||
}</ | }</ | ||
Line 53: | Line 47: | ||
Here is an example of a switch / case statement: | Here is an example of a switch / case statement: | ||
- | <code php> | + | <code php> |
- | { | + | |
case 1: | case 1: | ||
action1; | action1; |