Skip to content

Commit d63fe60

Browse files
przemekhernikjrfnl
authored andcommitted
[Documentation] Squiz.WhiteSpace.FunctionClosingBraceSpace (#408)
* add docs for FunctionClosingBraceSpace sniff
1 parent 81144b8 commit d63fe60

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<documentation title="Function Closing Brace Space">
2+
<standard>
3+
<![CDATA[
4+
There should be a single blank line before the function closing brace.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: A single blank line before the function closing brace.">
9+
<![CDATA[
10+
function outer() <em>{
11+
12+
}</em>
13+
]]>
14+
</code>
15+
<code title="Invalid: No blank line before the function closing brace.">
16+
<![CDATA[
17+
function outer() <em>{}</em>
18+
]]>
19+
</code>
20+
</code_comparison>
21+
22+
<standard>
23+
<![CDATA[
24+
Closing brace of nested function must be on a new line.
25+
]]>
26+
</standard>
27+
<code_comparison>
28+
<code title="Valid: Nested function closing brace is on a new line.">
29+
<![CDATA[
30+
function outer() {
31+
function inner() <em>{
32+
}</em>
33+
34+
}
35+
]]>
36+
</code>
37+
<code title="Invalid: Nested function closing brace on the same line.">
38+
<![CDATA[
39+
function outer() {
40+
function inner() <em>{}</em>
41+
42+
}
43+
]]>
44+
</code>
45+
</code_comparison>
46+
47+
<standard>
48+
<![CDATA[
49+
Closing brace of nested function must not be followed by a blank line.
50+
]]>
51+
</standard>
52+
<code_comparison>
53+
<code title="Valid: No blank line before the closing brace of a nested function.">
54+
<![CDATA[
55+
function outer() {
56+
function inner() <em>{
57+
}</em>
58+
59+
}
60+
]]>
61+
</code>
62+
<code title="Invalid: A single blank line before the closing brace of a nested function.">
63+
<![CDATA[
64+
function outer() {
65+
function inner() <em>{
66+
67+
}</em>
68+
69+
}
70+
]]>
71+
</code>
72+
</code_comparison>
73+
</documentation>

0 commit comments

Comments
 (0)