Summary: It is not correct to add a trailing comma if the `n_ARRAY_VALUE` node is a heredoc string.
Test Plan: Added a test case.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Differential Revision: https://secure.phabricator.com/D10569
$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,
'foo',
array('foo')
);
+array(
+ 'foo' => <<<EOTEXT
+This is some heredoc text.
+EOTEXT
+);
~~~~~~~~~~
advice:3:14
advice:12:3
'foo',
array('foo'),
);
+array(
+ 'foo' => <<<EOTEXT
+This is some heredoc text.
+EOTEXT
+);