Skip to content

Commit 53ecefb

Browse files
dingo-djrfnl
authored andcommitted
[Documentation] PSR12 - Closing Brace (#170)
* Add the documentation for the PSR12 Closing Brace Sniff
1 parent 52dcb00 commit 53ecefb

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<documentation title="Closing Brace">
2+
<standard>
3+
<![CDATA[
4+
The closing brace of object-oriented constructs and functions must not be followed by any comment or statement on the same line.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: Closing brace is the last content on the line.">
9+
<![CDATA[
10+
class Foo
11+
{
12+
// Class content.
13+
}<em></em>
14+
15+
function bar()
16+
{
17+
// Function content.
18+
}<em></em>
19+
]]>
20+
</code>
21+
<code title="Invalid: Comment or statement following the closing brace on the same line.">
22+
<![CDATA[
23+
interface Foo2
24+
{
25+
// Interface content.
26+
} <em>echo 'Hello!';</em>
27+
28+
function bar()
29+
{
30+
// Function content.
31+
} <em>//end bar()</em>
32+
]]>
33+
</code>
34+
</code_comparison>
35+
</documentation>

0 commit comments

Comments
 (0)