Skip to content

Commit 1238c8a

Browse files
committed
Docs: add documentation for Squiz.WhiteSpace.SuperfluousWhitespace
1 parent 68a8a34 commit 1238c8a

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<documentation title="Superfluous Whitespace">
2+
<standard>
3+
<![CDATA[
4+
There should be no extra whitespace at the start of a file.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: No whitespace preceding first content in file.">
9+
<![CDATA[<?php
10+
echo 'hi';
11+
]]>
12+
</code>
13+
<code title="Invalid: Whitespace used before content in file.">
14+
<![CDATA[
15+
<em></em>
16+
<?php
17+
echo 'hi';
18+
]]>
19+
</code>
20+
</code_comparison>
21+
<standard>
22+
<![CDATA[
23+
There should be no trailing whitespace at the end of lines.
24+
]]>
25+
</standard>
26+
<code_comparison>
27+
<code title="Valid: No whitespace found at end of line.">
28+
<![CDATA[
29+
echo 'hello';
30+
]]>
31+
</code>
32+
<code title="Invalid: Whitespace found at end of line.">
33+
<![CDATA[
34+
echo 'hello';<em> </em>
35+
]]>
36+
</code>
37+
</code_comparison>
38+
<standard>
39+
<![CDATA[
40+
There should be no more than one consecutive blank newline in functions.
41+
]]>
42+
</standard>
43+
<code_comparison>
44+
<code title="Valid: Functions do not contain multiple empty lines in a row.">
45+
<![CDATA[
46+
function myFunction()
47+
{
48+
echo 'code here';
49+
50+
echo 'code here';
51+
}
52+
]]>
53+
</code>
54+
<code title="Invalid: Functions contain multiple empty lines in a row.">
55+
<![CDATA[
56+
function myFunction()
57+
{
58+
echo 'code here';
59+
<em>
60+
61+
</em>echo 'code here';
62+
}
63+
]]>
64+
</code>
65+
</code_comparison>
66+
</documentation>

0 commit comments

Comments
 (0)