Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F9583404
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/lint/linter/__tests__/xhpast/embedded-tags.lint-test b/src/lint/linter/__tests__/xhpast/embedded-tags.lint-test
index b9f6be44..d15cefb5 100644
--- a/src/lint/linter/__tests__/xhpast/embedded-tags.lint-test
+++ b/src/lint/linter/__tests__/xhpast/embedded-tags.lint-test
@@ -1,5 +1,4 @@
<?php $x ?>
This shouldn't fatal the parser.
~~~~~~~~~~
-error:1:10
diff --git a/src/lint/linter/__tests__/xhpast/php-tags-bad.lint-test b/src/lint/linter/__tests__/xhpast/php-tags-bad.lint-test
index e749bfa6..7fb52e73 100644
--- a/src/lint/linter/__tests__/xhpast/php-tags-bad.lint-test
+++ b/src/lint/linter/__tests__/xhpast/php-tags-bad.lint-test
@@ -1,12 +1,11 @@
garbage garbage
<?php
?>
~~~~~~~~~~
error:1:1
-error:4:1
~~~~~~~~~~
garbage garbage
<?php
?>
diff --git a/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php
index 9a1a9db7..1b943b54 100644
--- a/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php
@@ -1,20 +1,26 @@
<?php
final class ArcanistPHPCloseTagXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 8;
public function getLintName() {
return pht('Use of Close Tag "%s"', '?>');
}
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,
pht('Do not use the PHP closing tag, "%s".', '?>'));
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Oct 11, 09:34 (8 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
984139
Default Alt Text
(1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment