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
Single line control structures must have no spaces after the condition opening parenthesis and before the condition closing parenthesis.
5
+
]]>
6
+
</standard>
7
+
<code_comparison>
8
+
<codetitle="Valid: No space after the opening parenthesis in a single-line condition.">
9
+
<![CDATA[
10
+
if <em>(</em>$expr) {
11
+
}
12
+
]]>
13
+
</code>
14
+
<codetitle="Invalid: Space after the opening parenthesis in a single-line condition.">
15
+
<![CDATA[
16
+
if <em>( </em>$expr) {
17
+
}
18
+
]]>
19
+
</code>
20
+
</code_comparison>
21
+
<code_comparison>
22
+
<codetitle="Valid: No space before the closing parenthesis in a single-line condition.">
23
+
<![CDATA[
24
+
if <em>(</em>$expr) {
25
+
}
26
+
]]>
27
+
</code>
28
+
<codetitle="Invalid: Space before the closing parenthesis in a single-line condition.">
29
+
<![CDATA[
30
+
if ($expr<em> )</em> {
31
+
}
32
+
]]>
33
+
</code>
34
+
</code_comparison>
35
+
<standard>
36
+
<![CDATA[
37
+
The condition of the multi-line control structure must be indented once, placing the first expression on the next line after the opening parenthesis.
38
+
]]>
39
+
</standard>
40
+
<code_comparison>
41
+
<codetitle="Valid: First expression of a multi-line control structure condition block is on the line after the opening parenthesis.">
42
+
<![CDATA[
43
+
while (
44
+
<em>$expr1</em>
45
+
&& $expr2
46
+
) {
47
+
}
48
+
]]>
49
+
</code>
50
+
<codetitle="Invalid: First expression of a multi-line control structure condition block is on the same line as the opening parenthesis.">
51
+
<![CDATA[
52
+
while <em>($expr1</em>
53
+
&& $expr2
54
+
) {
55
+
}
56
+
]]>
57
+
</code>
58
+
</code_comparison>
59
+
<code_comparison>
60
+
<codetitle="Valid: Each line in a multi-line control structure condition block indented at least once. Default indentation is 4 spaces.">
61
+
<![CDATA[
62
+
while (
63
+
<em> </em>$expr1
64
+
<em> </em>&& $expr2
65
+
) {
66
+
}
67
+
]]>
68
+
</code>
69
+
<codetitle="Invalid: Some lines in a multi-line control structure condition block not indented correctly.">
70
+
<![CDATA[
71
+
while (
72
+
<em>$expr1</em>
73
+
&& $expr2
74
+
<em> && $expr3</em>
75
+
) {
76
+
}
77
+
]]>
78
+
</code>
79
+
</code_comparison>
80
+
<standard>
81
+
<![CDATA[
82
+
The closing parenthesis of the multi-line control structure must be on the next line after the last condition, indented to the same level as the start of the control structure.
83
+
]]>
84
+
</standard>
85
+
<code_comparison>
86
+
<codetitle="Valid: The closing parenthesis of a multi-line control structure condition block is on the line after the last expression.">
87
+
<![CDATA[
88
+
while (
89
+
$expr1
90
+
&& $expr2
91
+
<em>)</em> {
92
+
}
93
+
]]>
94
+
</code>
95
+
<codetitle="Invalid: The closing parenthesis of a multi-line control structure condition block is on the same line as the last expression.">
96
+
<![CDATA[
97
+
while (
98
+
$expr1
99
+
<em>&& $expr2)</em> {
100
+
}
101
+
]]>
102
+
</code>
103
+
</code_comparison>
104
+
<code_comparison>
105
+
<codetitle="Valid: The closing parenthesis of a multi-line control structure condition block is indented to the same level as start of the control structure.">
106
+
<![CDATA[
107
+
while (
108
+
$expr1
109
+
&& $expr2
110
+
<em>)</em> {
111
+
}
112
+
]]>
113
+
</code>
114
+
<codetitle="Invalid: The closing parenthesis of a multi-line control structure condition block is not indented to the same level as start of the control structure.">
0 commit comments