Skip to content

Commit

Permalink
Generic/EmptyPHPStatement: add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoprimo committed Dec 14, 2023
1 parent 88d3cec commit 60eeaca
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 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>

0 comments on commit 60eeaca

Please sign in to comment.