PhpParser\PrettyPrinterAbstract::pComments PHP Method

pComments() protected method

Prints reformatted text of the passed comments.
protected pComments ( array $comments ) : string
$comments array List of comments
return string Reformatted text of comments
    protected function pComments(array $comments)
    {
        $formattedComments = [];
        foreach ($comments as $comment) {
            $formattedComments[] = $comment->getReformattedText();
        }
        return implode("\n", $formattedComments);
    }