-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documentation] Squiz.WhiteSpace.FunctionClosingBraceSpace (#408)
* add docs for FunctionClosingBraceSpace sniff
- Loading branch information
1 parent
35b306c
commit 72b50b9
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
src/Standards/Squiz/Docs/WhiteSpace/FunctionClosingBraceSpaceStandard.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |