Skip to content

Commit b0e3be5

Browse files
committed
Generic/IncrementDecrementSpacing: add XML documentation
1 parent aeb53ae commit b0e3be5

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<documentation title="Increment Decrement Spacing">
2+
<standard>
3+
<![CDATA[
4+
There should be no whitespaces between a pre-increment/pre-decrement operator and a variable.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: No whitespaces between a pre-increment/pre-decrement operator and a variable.">
9+
<![CDATA[
10+
++<em></em>$i;
11+
--<em></em>ClassName::$prop;
12+
--<em></em>$obj->prop;
13+
]]>
14+
</code>
15+
<code title="Invalid: Whitespaces found between a pre-increment/pre-decrement operator and a variable.">
16+
<![CDATA[
17+
++<em> </em>$i;
18+
--<em> </em>ClassName::$prop;
19+
--<em>
20+
</em>$obj->prop;
21+
]]>
22+
</code>
23+
</code_comparison>
24+
<standard>
25+
<![CDATA[
26+
There should be no whitespaces between a variable and a post-increment/post-decrement operator.
27+
]]>
28+
</standard>
29+
<code_comparison>
30+
<code title="Valid: No whitespaces between a variable and a post-increment/post-decrement operator.">
31+
<![CDATA[
32+
<em></em>$i++;
33+
<em></em>ClassName::$prop++;
34+
<em></em>$obj->prop--;
35+
]]>
36+
</code>
37+
<code title="Invalid: Whitespaces found between a variable and a post-increment/post-decrement operator.">
38+
<![CDATA[
39+
$i<em> </em>++;
40+
ClassName::$prop<em> </em>++;
41+
$obj->prop<em>
42+
</em>--;
43+
]]>
44+
</code>
45+
</code_comparison>
46+
</documentation>

0 commit comments

Comments
 (0)