forked from PHPCSStandards/PHP_CodeSniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/EmptyPHPStatement: add documentation
- Loading branch information
1 parent
88d3cec
commit 60eeaca
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/Standards/Generic/Docs/CodeAnalysis/EmptyPHPStatementStandard.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,44 @@ | ||
<documentation title="Empty PHP Statement"> | ||
<standard> | ||
<![CDATA[ | ||
Empty PHP tags are not allowed. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: There is at least one statement inside the PHP tag pair."> | ||
<![CDATA[ | ||
<?php echo 'Hello World'; ?> | ||
<?= 'Hello World'; ?> | ||
]]> | ||
</code> | ||
<code title="Invalid: There is no statement inside the PHP tag pair."> | ||
<![CDATA[ | ||
<?php // some comment ?> | ||
<?= ?> | ||
]]> | ||
</code> | ||
</code_comparison> | ||
<standard> | ||
<![CDATA[ | ||
Superfluous semi-colons are not allowed. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: There is no superfluous semi-colon after a PHP statement."> | ||
<![CDATA[ | ||
function_call(); | ||
if (true) { | ||
echo 'Hello World'; | ||
} | ||
]]> | ||
</code> | ||
<code title="Invalid: There are one or more superfluous semi-colons after a PHP statement."> | ||
<![CDATA[ | ||
function_call();;; | ||
if (true) { | ||
echo 'Hello World'; | ||
}; | ||
]]> | ||
</code> | ||
</code_comparison> | ||
</documentation> |