Summary: Ref T8742. PHP files which contain inline HTML should be allowed to use PHP closing tags (`?>`). This is in accordance with [[https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md | PSR-2 guidelines]].
Test Plan: Updated unit tests.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin
Maniphest Tasks: T8742
Differential Revision: https://secure.phabricator.com/D13794
This shouldn't fatal the parser.
~~~~~~~~~~
-error:1:10
?>
~~~~~~~~~~
error:1:1
-error:4:1
~~~~~~~~~~
garbage garbage
<?php
}
public function process(XHPASTNode $root) {
+ $inline_html = $root->selectDescendantsOfType('n_INLINE_HTML');
+
+ if ($inline_html) {
+ return;
+ }
+
foreach ($root->selectTokensOfType('T_CLOSE_TAG') as $token) {
$this->raiseLintAtToken(
$token,