Skip to content

Commit

Permalink
[Documentation] Squiz.WhiteSpace.FunctionClosingBraceSpace (#408)
Browse files Browse the repository at this point in the history
* add docs for FunctionClosingBraceSpace sniff
  • Loading branch information
przemekhernik committed May 16, 2024
1 parent 35b306c commit 72b50b9
Showing 1 changed file with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<documentation title="Function Closing Brace Space">
<standard>
<![CDATA[
There should be a single blank line before the function closing brace.
]]>
</standard>
<code_comparison>
<code title="Valid: A single blank line before the function closing brace.">
<![CDATA[
function outer() <em>{
}</em>
]]>
</code>
<code title="Invalid: No blank line before the function closing brace.">
<![CDATA[
function outer() <em>{}</em>
]]>
</code>
</code_comparison>

<standard>
<![CDATA[
Closing brace of nested function must be on a new line.
]]>
</standard>
<code_comparison>
<code title="Valid: Nested function closing brace is on a new line.">
<![CDATA[
function outer() {
function inner() <em>{
}</em>
}
]]>
</code>
<code title="Invalid: Nested function closing brace on the same line.">
<![CDATA[
function outer() {
function inner() <em>{}</em>
}
]]>
</code>
</code_comparison>

<standard>
<![CDATA[
Closing brace of nested function must not be followed by a blank line.
]]>
</standard>
<code_comparison>
<code title="Valid: No blank line before the closing brace of a nested function.">
<![CDATA[
function outer() {
function inner() <em>{
}</em>
}
]]>
</code>
<code title="Invalid: A single blank line before the closing brace of a nested function.">
<![CDATA[
function outer() {
function inner() <em>{
}</em>
}
]]>
</code>
</code_comparison>
</documentation>

0 comments on commit 72b50b9

Please sign in to comment.