Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Description.php

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\DocBlock

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal