Copied!

Converts a DocBlock back from an object to a complete DocComment including Asterisks.

CloneableInstantiable
Methods
public __construct(int $indent = 0, string $indentString = ' ', bool $indentFirstLine = true, ?int $lineLength = NULL, ?phpDocumentor\Reflection\DocBlock\Tags\Formatter $tagFormatter = NULL, string $lineEnding = ' ')
 

Create a Serializer instance.

  • param int $indent The number of times the indent string is repeated.
  • param string $indentString The string to indent the comment with.
  • param bool $indentFirstLine Whether to indent the first line.
  • param int|null $lineLength The max length of a line or NULL to disable line wrapping.
  • param \Formatter $tagFormatter A custom tag formatter, defaults to PassthroughFormatter.
  • param string $lineEnding Line ending used in the output, by default \n is used.
public getDocComment(phpDocumentor\Reflection\DocBlock $docblock) : string
 

Generate a DocBlock comment.

  • param \DocBlock $docblock The DocBlock to serialize.
  • return string The serialized doc block.
Properties
protected int $indent = 0
 
  • var int The number of times the indent string is repeated.
protected string $indentString = ' '
 
  • var string The string to indent the comment with.
protected bool $isFirstLineIndented = true
 
  • var bool Whether to indent the first line with the given indent amount and string.
protected ?int $lineLength = NULL
 
  • var int|null The max length of a line.
protected phpDocumentor\Reflection\DocBlock\Tags\Formatter $tagFormatter
 
  • var \Formatter A custom tag formatter.
Properties
private string $lineEnding
Methods
private addAsterisksForEachLine(string $indent, string $text) : string
private addTagBlock(phpDocumentor\Reflection\DocBlock $docblock, ?int $wrapLength, string $indent, string $comment) : string
private getSummaryAndDescriptionTextBlock(phpDocumentor\Reflection\DocBlock $docblock, ?int $wrapLength) : string
private removeTrailingSpaces(string $indent, string $text) : string
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration