Skip to content

Commit

Permalink
Generic/EmptyPHPStatement: add XML documentation (#166)
Browse files Browse the repository at this point in the history
* Generic/EmptyPHPStatement: add documentation

* Fix one of the invalid examples in EmptyPHPStatementStandard.xml
  • Loading branch information
rodrigoprimo authored and jrfnl committed Jan 5, 2024
1 parent acc5b5b commit 0caeaab
Showing 1 changed file with 44 additions and 0 deletions.
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 <em>echo 'Hello World';</em> ?>
<?= <em>'Hello World';</em> ?>
]]>
</code>
<code title="Invalid: There is no statement inside the PHP tag pair.">
<![CDATA[
<?php <em>;</em> ?>
<?= <em></em> ?>
]]>
</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()<em>;</em>
if (true) {
echo 'Hello World'<em>;</em>
}
]]>
</code>
<code title="Invalid: There are one or more superfluous semi-colons after a PHP statement.">
<![CDATA[
function_call()<em>;;;</em>
if (true) {
echo 'Hello World';
}<em>;</em>
]]>
</code>
</code_comparison>
</documentation>

0 comments on commit 0caeaab

Please sign in to comment.