Skip to content

Commit 1f90b17

Browse files
committed
Combine code examples into a single <code_comparison> block
Doing this based on the PR review (#159 (comment)) as the valid code examples are essentially the same. This commit also changes the changes the type cast used in the second example to make it more clear that this sniff is not only about `(int)` type casts.
1 parent c9c9b09 commit 1f90b17

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/Standards/Generic/Docs/Formatting/SpaceBeforeCastStandard.xml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@
88
<code title="Valid: Single space before a cast operator.">
99
<![CDATA[
1010
$integer =<em> </em>(int) $string;
11+
$c = $a .<em> </em>(string) $b;
1112
]]>
1213
</code>
13-
<code title="Invalid: No space before a cast operator.">
14+
<code title="Invalid: No space or multiple spaces before a cast operator.">
1415
<![CDATA[
1516
$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;
17+
$c = $a .<em> </em>(string) $b;
2818
]]>
2919
</code>
3020
</code_comparison>

0 commit comments

Comments
 (0)