Lggr
Public Member Functions | List of all members
phpDocumentor\Reflection\DocBlock\DescriptionFactory Class Reference

Public Member Functions

 __construct (TagFactory $tagFactory)
 
 create (string $contents, ?TypeContext $context=null)
 

Detailed Description

Creates a new Description object given a body of text.

Descriptions in phpDocumentor are somewhat complex entities as they can contain one or more tags inside their body that can be replaced with a readable output. The replacing is done by passing a Formatter object to the Description object's render method.

In addition to the above does a Description support two types of escape sequences:

  1. {@} to escape the @ character to prevent it from being interpreted as part of a tag, i.e. {{@}link}
  2. {} to escape the } character, this can be used if you want to use the } character in the description of an inline tag.

If a body consists of multiple lines then this factory will also remove any superfluous whitespace at the beginning of each line while maintaining any indentation that is used. This will prevent formatting parsers from tripping over unexpected spaces as can be observed with tag descriptions.

Constructor & Destructor Documentation

◆ __construct()

phpDocumentor\Reflection\DocBlock\DescriptionFactory::__construct ( TagFactory  $tagFactory)

Initializes this factory with the means to construct (inline) tags.

Member Function Documentation

◆ create()

phpDocumentor\Reflection\DocBlock\DescriptionFactory::create ( string  $contents,
?TypeContext  $context = null 
)

Returns the parsed text of this description.


The documentation for this class was generated from the following file: