Page MenuHomePhabricator

D10569.id25388.diff
No OneTemporary

D10569.id25388.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
@@ -2737,6 +2737,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, Nov 11, 11:15 AM (2 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6722950
Default Alt Text
D10569.id25388.diff (1 KB)

Event Timeline