-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documentation] PSR12 - Closing Brace (#170)
* Add the documentation for the PSR12 Closing Brace Sniff
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
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,35 @@ | ||
<documentation title="Closing Brace"> | ||
<standard> | ||
<![CDATA[ | ||
The closing brace of object-oriented constructs and functions must not be followed by any comment or statement on the same line. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: Closing brace is the last content on the line."> | ||
<![CDATA[ | ||
class Foo | ||
{ | ||
// Class content. | ||
}<em></em> | ||
function bar() | ||
{ | ||
// Function content. | ||
}<em></em> | ||
]]> | ||
</code> | ||
<code title="Invalid: Comment or statement following the closing brace on the same line."> | ||
<![CDATA[ | ||
interface Foo2 | ||
{ | ||
// Interface content. | ||
} <em>echo 'Hello!';</em> | ||
function bar() | ||
{ | ||
// Function content. | ||
} <em>//end bar()</em> | ||
]]> | ||
</code> | ||
</code_comparison> | ||
</documentation> |