function QuoteAwareConstExprStringNode::__toString
Overrides ConstExprStringNode::__toString
File
-
vendor/
phpstan/ phpdoc-parser/ src/ Ast/ ConstExpr/ QuoteAwareConstExprStringNode.php, line 37
Class
Namespace
PHPStan\PhpDocParser\Ast\ConstExprCode
public function __toString() : string {
if ($this->quoteType === self::SINGLE_QUOTED) {
// from https://github.com/nikic/PHP-Parser/blob/0ffddce52d816f72d0efc4d9b02e276d3309ef01/lib/PhpParser/PrettyPrinter/Standard.php#L1007
return sprintf("'%s'", addcslashes($this->value, '\'\\'));
}
// from https://github.com/nikic/PHP-Parser/blob/0ffddce52d816f72d0efc4d9b02e276d3309ef01/lib/PhpParser/PrettyPrinter/Standard.php#L1010-L1040
return sprintf('"%s"', $this->escapeDoubleQuotedString());
}