function PrettyPrinterAbstract::pComments
Prints reformatted text of the passed comments.
Parameters
Comment[] $comments List of comments:
Return value
string Reformatted text of comments
3 calls to PrettyPrinterAbstract::pComments()
- PrettyPrinterAbstract::pArray in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Perform a format-preserving pretty print of an array.
- PrettyPrinterAbstract::pCommaSeparatedMultiline in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Pretty prints a comma-separated list of nodes in multiline style, including comments.
- PrettyPrinterAbstract::pStmts in vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php - Pretty prints an array of nodes (statements) and indents them optionally.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinterAbstract.php, line 531
Class
Namespace
PhpParserCode
protected function pComments(array $comments) : string {
$formattedComments = [];
foreach ($comments as $comment) {
$formattedComments[] = str_replace("\n", $this->nl, $comment->getReformattedText());
}
return implode($this->nl, $formattedComments);
}