protected function pScalar_Encapsed(Scalar\Encapsed $node) {
if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) {
$label = $node->getAttribute('docLabel');
if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) {
if (count($node->parts) === 1
&& $node->parts[0] instanceof Scalar\EncapsedStringPart
&& $node->parts[0]->value === ''
) {
return $this->pNoIndent("<<<$label\n$label") . $this->docStringEndToken;
}
return $this->pNoIndent(
"<<<$label\n" . $this->pEncapsList($node->parts, null) . "\n$label"
) . $this->docStringEndToken;
}
}
return '"' . $this->pEncapsList($node->parts, '"') . '"';
}