mirror of
https://github.com/nextcloud/documentation.git
synced 2025-10-26 11:18:02 +00:00
codingguidelines: Don't use a different style for loops
This commit is contained in:
parent
6a07c9429b
commit
f2edb301d1
@ -109,7 +109,6 @@ Control Structures
|
||||
* Always use { } for one line ifs
|
||||
* Split long ifs into multiple lines
|
||||
* Always use break in switch statements and prevent a default block with warnings if it shouldn't be accessed
|
||||
* Do not put spaces between variable and assignments in for loops
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
@ -131,7 +130,7 @@ Control Structures
|
||||
}
|
||||
|
||||
// for loop
|
||||
for ($i=0; $i<4; $i++) {
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
// your code
|
||||
}
|
||||
|
||||
@ -282,7 +281,6 @@ Control Structures
|
||||
* Always use { } for one line ifs
|
||||
* Split long ifs into multiple lines
|
||||
* Always use break in switch statements and prevent a default block with warnings if it shouldn't be accessed
|
||||
* Do not put spaces between variable and assignments in for loops
|
||||
|
||||
**DO**:
|
||||
|
||||
@ -304,7 +302,7 @@ Control Structures
|
||||
}
|
||||
|
||||
// for loop
|
||||
for (var i=0; i<4; i++) {
|
||||
for (var i = 0; i < 4; i++) {
|
||||
// your code
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user