User Tools

Site Tools


en:dev:all:psr:psr-2

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
Next revisionBoth sides next revision
en:dev:all:psr:psr-2 [26.05.2015 19:53] – [Kontrollstrukturen] renamed and translated mrbasemanen:dev:all:psr:psr-2 [26.05.2015 20:13] – [try, catch] translated mrbaseman
Line 244: Line 244:
 The body of each structure MUST be enclosed by braces. This standardizes how the structures look, and reduces the likelihood of introducing errors as new lines get added to the body. The body of each structure MUST be enclosed by braces. This standardizes how the structures look, and reduces the likelihood of introducing errors as new lines get added to the body.
 ==== if, elseif, else ==== ==== if, elseif, else ====
-Eine **if**-Struktur sieht wie nachfolgend ausBeachten Sie die Plazierung von KlammernLeerstellen und geschweiften Klammern. Die Schlüsselwörter **else** und **elseif** MÜSSEN sich mit einer Leerstelle Abstand auf der selben Zeile befinden, wie die schließende, geschweifte Klammer des vorhergehenden Strukturkörpers.+An **if** structure looks like the followingNote the placement of parenthesesspaces, and braces; and that **else** and **elseif** MUST be on the same line as the closing brace from the earlier body separated by one space character.
 <PHP> <PHP>
 if ($expr1) { if ($expr1) {
Line 254: Line 254:
 } }
 </PHP> </PHP>
-Das Schlüsselwort **elseif** SOLLTE anstelle von **else if** so dass alle Schlüsselworte wie einzelne Worte aussehen. +The keyword **elseif** SHOULD be used instead of **else if** so that all control keywords look like single words.
- +
 ==== switch, case ==== ==== switch, case ====
-Eine **switch**-Struktur sieht wie nachfolgend ausBeachten Sie die Plazierung von KlammernLeerstellen und geschweiften Klammern. +**switch** structure looks like the followingNote the placement of parentheses, spacesand bracesThe **case** statement MUST be indented once from **switch**, and the **break** keyword (or other terminating keywordMUST be indented at the same level as the **case** bodyThere MUST be a comment such as %%//%%// no break// when 'fall-throughis intentional in a non-empty **case** body.
-Das **case**-Statement MUSS eine Stufe ab **switch** eingerückt werden und das **break** Schlüsselwort (oder ein anderes, abschließendes SchlüsselwortMUSS auf die selbe Ebene eingerückt werden, wie der **case**-KörperEs MUSS ein Kommentar wie %%//%%// no break//  eingefügt werden, wenn ein 'durchfallenzum nächsten **case** erwünscht ist.+
 <PHP> <PHP>
 switch ($expr) { switch ($expr) {
Line 278: Line 275:
 } }
 </PHP> </PHP>
- 
- 
  
 ==== while, do while ==== ==== while, do while ====
-Ein **while**-Statement sieht wie nachfolgend ausBeachten Sie die Plazierung von KlammernLeerstellen und geschweiften Klammern.+**while** statement looks like the followingNote the placement of parenthesesspaces, and braces.
 <PHP> <PHP>
 while ($expr) { while ($expr) {
Line 288: Line 283:
 } }
 </PHP> </PHP>
-ebenso sieht ein **do while**-Statement wie nachfolgend ausBeachten Sie die Plazierung von KlammernLeerstellen und geschweiften Klammern.+Similarly, a **do while** statement looks like the followingNote the placement of parentheses, spacesand braces.
 <PHP> <PHP>
 do { do {
Line 294: Line 289:
 } while ($expr); } while ($expr);
 </PHP> </PHP>
- 
- 
  
 ==== for ==== ==== for ====
-Ein **for**-Statement sieht wie nachfolgend ausBeachten Sie die Plazierung von KlammernLeerstellen und geschweiften Klammern+**for** statement looks like the followingNote the placement of parenthesesspaces, and braces.
 <PHP> <PHP>
 for ($i = 0; $i < 10; $i++) { for ($i = 0; $i < 10; $i++) {
Line 304: Line 297:
 } }
 </PHP> </PHP>
- 
  
 ==== foreach ==== ==== foreach ====
-Ein **foreach**-Statement sieht wie nachfolgend ausBeachten Sie die Plazierung von KlammernLeerstellen und geschweiften Klammern+**foreach** statement looks like the followingNote the placement of parenthesesspaces, and braces.
 <PHP> <PHP>
 foreach ($iterable as $key => $value) { foreach ($iterable as $key => $value) {
Line 316: Line 308:
  
 ==== try, catch ==== ==== try, catch ====
-Ein **try catch**-Statement sieht wie nachfolgend ausBeachten Sie die Plazierung von KlammernLeerstellen und geschweiften Klammern+**try catch** block looks like the followingNote the placement of parenthesesspaces, and braces.
 <PHP> <PHP>
 try { try {
en/dev/all/psr/psr-2.txt · Last modified: 31.03.2017 06:59 by Manuela v.d.Decken