function Description::render
Renders this description as a string where the provided formatter will format the tags in the expected string format.
1 call to Description::render()
- Description::__toString in vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlock/ Description.php - Returns a plain string representation of this description.
File
-
vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlock/ Description.php, line 93
Class
- Description
- Object representing to description for a DocBlock.
Namespace
phpDocumentor\Reflection\DocBlockCode
public function render(?Formatter $formatter = null) : string {
if ($this->tags === []) {
return vsprintf($this->bodyTemplate, []);
}
if ($formatter === null) {
$formatter = new PassthroughFormatter();
}
$tags = [];
foreach ($this->tags as $tag) {
$tags[] = '{' . $formatter->format($tag) . '}';
}
return vsprintf($this->bodyTemplate, $tags);
}