You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manual/en-US/coding-standards/chapters/inline-comments.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,19 @@ Don’t use a blank line between comments and the code they refer to (no space u
18
18
19
19
Always have a single blank line before a comment or block of comments unless the comment (or block) is at the beginning of a code structure. ( You should not have a blank line after a '{' line )
20
20
21
+
For example in the following case there is no new line before the first comment (because it follows a '{' line) but we do want a new line before the second comment:
22
+
23
+
```php
24
+
while (!$done)
25
+
{
26
+
// We don't want an infinite loop here.
27
+
$done = true;
28
+
}
29
+
30
+
//Now let's do something interesting.
31
+
$result = somethingInteresting();
32
+
```
33
+
21
34
Comments should align with the code they refer to, using the same indenting as the line that follows the comment.
22
35
23
36
Comments should be indented with tabs (like code, not like doc blocks).
0 commit comments