Skip to content

Commit 50ae189

Browse files
committed
Squiz/EmbeddedPhp: document the behaviour for closed tag block at end of file [3]
While the last tag block in a file will **not** be ignored if it is followed by non-empty inline HTML, the "blank lines before the close tag" check _will_ be ignored if this is the last embedded PHP block. This test documents this behaviour.
1 parent ac5fd07 commit 50ae189

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
// This test case file MUST always start with a long open PHP tag set (with this comment) to prevent
3+
// the tests running into the "first PHP open tag excepted" condition breaking the tests.
4+
// Tests related to that "first PHP open tag excepted" condition should go in separate files.
5+
?>
6+
<!--
7+
The "blank lines before close tag" check will not be executed when this is the last embedded PHP block.
8+
9+
Note: I am not sure what the reason is for this exception, but the sniff has had this behaviour for the longest time,
10+
so this test documents the behaviour without an opinion on the correctness.
11+
-->
12+
<div>
13+
<?php
14+
echo 'There are a few too many blank lines below this line';
15+
16+
17+
18+
19+
20+
?>
21+
22+
</div>
23+
<p>Some more content after the last PHP tag block.</p>

0 commit comments

Comments
 (0)