function PrettyPrinterAbstract::handleMagicTokens
Handles (and removes) doc-string-end tokens.
3 calls to PrettyPrinterAbstract::handleMagicTokens()
- PrettyPrinterAbstract::prettyPrint in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Pretty prints an array of statements.
- PrettyPrinterAbstract::prettyPrintExpr in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Pretty prints an expression.
- PrettyPrinterAbstract::printFormatPreserving in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Perform a format-preserving pretty print of an AST.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php, line 327
Class
Namespace
PhpParserCode
protected function handleMagicTokens(string $str) : string {
if ($this->docStringEndToken !== null) {
// Replace doc-string-end tokens with nothing or a newline
$str = str_replace($this->docStringEndToken . ';' . $this->newline, ';' . $this->newline, $str);
$str = str_replace($this->docStringEndToken, $this->newline, $str);
}
return $str;
}