Page MenuHomePhabricator

D10569.diff
No OneTemporary

D10569.diff

diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php
--- a/src/lint/linter/ArcanistXHPASTLinter.php
+++ b/src/lint/linter/ArcanistXHPASTLinter.php
@@ -2736,6 +2736,10 @@
$after = last($value->getTokens())->getNextToken();
if ($multiline && (!$after || $after->getValue() != ',')) {
+ if ($value->getChildByIndex(1)->getTypeName() == 'n_HEREDOC') {
+ continue;
+ }
+
$this->raiseLintAtNode(
$value,
self::LINT_ARRAY_SEPARATOR,
diff --git a/src/lint/linter/__tests__/xhpast/array-comma.lint-test b/src/lint/linter/__tests__/xhpast/array-comma.lint-test
--- a/src/lint/linter/__tests__/xhpast/array-comma.lint-test
+++ b/src/lint/linter/__tests__/xhpast/array-comma.lint-test
@@ -15,6 +15,11 @@
'foo',
array('foo')
);
+array(
+ 'foo' => <<<EOTEXT
+This is some heredoc text.
+EOTEXT
+);
~~~~~~~~~~
advice:3:14
advice:12:3
@@ -37,3 +42,8 @@
'foo',
array('foo'),
);
+array(
+ 'foo' => <<<EOTEXT
+This is some heredoc text.
+EOTEXT
+);

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 21, 3:09 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6726682
Default Alt Text
D10569.diff (1 KB)

Event Timeline