function Standard::pScalar_InterpolatedString
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinter/ Standard.php, line 180
Class
Namespace
PhpParser\PrettyPrinterCode
protected function pScalar_InterpolatedString(Scalar\InterpolatedString $node) : string {
if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) {
$label = $node->getAttribute('docLabel');
if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) {
$nl = $this->phpVersion
->supportsFlexibleHeredoc() ? $this->nl : $this->newline;
if (count($node->parts) === 1 && $node->parts[0] instanceof Node\InterpolatedStringPart && $node->parts[0]->value === '') {
return "<<<{$label}{$nl}{$label}{$this->docStringEndToken}";
}
return "<<<{$label}{$nl}" . $this->pEncapsList($node->parts, null) . "{$nl}{$label}{$this->docStringEndToken}";
}
}
return '"' . $this->pEncapsList($node->parts, '"') . '"';
}