PHP 클래스 phpDocumentor\Reflection\DocBlock\Description

A Description object can consist of plain text but can also include tags. A Description Formatter can then combine a body template with sprintf-style placeholders together with formatted tags in order to reconstitute a complete description text using the format that you would prefer. Because parsing a Description text can be a verbose process this is handled by the {@see \DescriptionFactory}. It is thus recommended to use that to create a Description object, like this: $description = $descriptionFactory->create('This is a {@see \Description}', $context); The description factory will interpret the given body and create a body template and list of tags from them, and pass that onto the constructor if this class. > The $context variable is a class of type {@see \phpDocumentor\Reflection\Types\Context} and contains the namespace > and the namespace aliases that apply to this DocBlock. These are used by the Factory to resolve and expand partial > type names and FQSENs. If you do not want to use the DescriptionFactory you can pass a body template and tag listing like this: $description = new Description( 'This is a %1$s', [ new See(new Fqsen('\phpDocumentor\Reflection\DocBlock\Description')) ] ); It is generally recommended to use the Factory as that will also apply escaping rules, while the Description object is mainly responsible for rendering.
또한 보기: DescriptionFactory to create a new Description.
또한 보기: Description\Formatter for the formatting of the body and tags.
파일 보기 프로젝트 열기: explodybits/hookr-plugin 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$contents string
$docblock The DocBlock which this description belongs to.
$parsedContents The contents, as an array of strings and Tag objects.

공개 메소드들

메소드 설명
__construct ( string $content, DocBlock $docblock = null ) Populates the fields of a description.
__toString ( ) : string Returns the exported information (we should use the export static method BUT this throws an exception at this point).
export ( ) : void Builds a string representation of this object.
getContents ( ) : string Gets the text of this description.
getDocBlock ( ) : DocBlock Gets the docblock this tag belongs to.
getFormattedContents ( ) : string Return a formatted variant of the Long Description using MarkDown.
getParsedContents ( ) : array Returns the parsed text of this description.
setContent ( string $content ) Sets the text of this description.
setDocBlock ( DocBlock $docblock = null ) Sets the docblock this tag belongs to.

메소드 상세

__construct() 공개 메소드

Populates the fields of a description.
public __construct ( string $content, DocBlock $docblock = null )
$content string The description's conetnts.
$docblock phpDocumentor\Reflection\DocBlock The DocBlock which this description belongs to.

__toString() 공개 메소드

Returns the exported information (we should use the export static method BUT this throws an exception at this point).
public __toString ( ) : string
리턴 string

export() 공개 정적인 메소드

Builds a string representation of this object.
public static export ( ) : void
리턴 void

getContents() 공개 메소드

Gets the text of this description.
public getContents ( ) : string
리턴 string

getDocBlock() 공개 메소드

Gets the docblock this tag belongs to.
public getDocBlock ( ) : DocBlock
리턴 phpDocumentor\Reflection\DocBlock The docblock this description belongs to.

getFormattedContents() 공개 메소드

Return a formatted variant of the Long Description using MarkDown.
public getFormattedContents ( ) : string
리턴 string

getParsedContents() 공개 메소드

Returns the parsed text of this description.
public getParsedContents ( ) : array
리턴 array An array of strings and tag objects, in the order they occur within the description.

setContent() 공개 메소드

Sets the text of this description.
public setContent ( string $content )
$content string The new text of this description.

setDocBlock() 공개 메소드

Sets the docblock this tag belongs to.
public setDocBlock ( DocBlock $docblock = null )
$docblock phpDocumentor\Reflection\DocBlock The new docblock this description belongs to. Setting NULL removes any association.

프로퍼티 상세

$contents 보호되어 있는 프로퍼티

protected string $contents
리턴 string

$docblock 보호되어 있는 프로퍼티

The DocBlock which this description belongs to.
protected $docblock

$parsedContents 보호되어 있는 프로퍼티

The contents, as an array of strings and Tag objects.
protected $parsedContents