Skip to content

[Documentation] Squiz.WhiteSpace.FunctionClosingBraceSpace #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>