Skip to content

Commit 9f44251

Browse files
committed
Add documentation for the SpaceBeforeCast sniff
1 parent 040f675 commit 9f44251

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<documentation title="Space Before Casts">
2+
<standard>
3+
<![CDATA[
4+
Ensures there is exactly one space before a cast operator.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: Single space before a cast operator.">
9+
<![CDATA[
10+
$integer =<em> </em>(int) $string;
11+
]]>
12+
</code>
13+
<code title="Invalid: No space before a cast operator.">
14+
<![CDATA[
15+
$integer =<em></em>(int) $string;
16+
]]>
17+
</code>
18+
</code_comparison>
19+
<code_comparison>
20+
<code title="Valid: Single space before a cast operator.">
21+
<![CDATA[
22+
$c = $a +<em> </em>(int) $b;
23+
]]>
24+
</code>
25+
<code title="Invalid: Multiple spaces before a cast operator.">
26+
<![CDATA[
27+
$c = $a +<em> </em>(int) $b;
28+
]]>
29+
</code>
30+
</code_comparison>
31+
</documentation>

0 commit comments

Comments
 (0)