PHP Класс phpDocumentor\Reflection\DocBlock

Автор: Mike van Riel ([email protected])
Наследование: implements Reflector
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$context Information about the context of this DocBlock.
$location Information about the location of this DocBlock.
$long_description The actual description for this docblock.
$short_description The opening line for this docblock.
$tags An array containing all the tags in this docblock; except inline.

Открытые методы

Метод Описание
__construct ( Reflector | string $docblock, phpDocumentor\Reflection\DocBlock\Context $context = null, phpDocumentor\Reflection\DocBlock\Location $location = null ) Parses the given docblock and populates the member fields.
__toString ( ) : string Returns the exported information (we should use the export static method BUT this throws an exception at this point).
appendTag ( Tag $tag ) : Tag Appends a tag at the end of the list of tags.
export ( ) : string Builds a string representation of this object.
getContext ( ) : phpDocumentor\Reflection\DocBlock\Context Returns the current context.
getLocation ( ) : phpDocumentor\Reflection\DocBlock\Location Returns the current location.
getLongDescription ( ) : Description Returns the full description or also known as long description.
getShortDescription ( ) : string Returns the opening line or also known as short description.
getTags ( ) : Tag[] Returns the tags for this DocBlock.
getTagsByName ( string $name ) : Tag[] Returns an array of tags matching the given name. If no tags are found an empty array is returned.
hasTag ( string $name ) : boolean Checks if a tag of a certain type is present in this DocBlock.

Защищенные методы

Метод Описание
cleanInput ( string $comment ) : string Strips the asterisks from the DocBlock comment.
parseTags ( string $tags ) : void Creates the tag objects.
splitDocBlock ( string $comment ) : string[] Splits the DocBlock into a short description, long description and block of tags.

Описание методов

__construct() публичный Метод

The constructor may also receive namespace information such as the current namespace and aliases. This information is used by some tags (e.g. @return, @param, etc.) to turn a relative Type into a FQCN.
public __construct ( Reflector | string $docblock, phpDocumentor\Reflection\DocBlock\Context $context = null, phpDocumentor\Reflection\DocBlock\Location $location = null )
$docblock Reflector | string A docblock comment (including asterisks) or reflector supporting the getDocComment method.
$context phpDocumentor\Reflection\DocBlock\Context The context in which the DocBlock occurs.
$location phpDocumentor\Reflection\DocBlock\Location The location within the file that this DocBlock occurs in.

__toString() публичный Метод

Returns the exported information (we should use the export static method BUT this throws an exception at this point).
public __toString ( ) : string
Результат string

appendTag() публичный Метод

Appends a tag at the end of the list of tags.
public appendTag ( Tag $tag ) : Tag
$tag phpDocumentor\Reflection\DocBlock\Tag The tag to add.
Результат phpDocumentor\Reflection\DocBlock\Tag The newly added tag.

cleanInput() защищенный Метод

Strips the asterisks from the DocBlock comment.
protected cleanInput ( string $comment ) : string
$comment string String containing the comment text.
Результат string

export() публичный статический Метод

Builds a string representation of this object.
public static export ( ) : string
Результат string

getContext() публичный Метод

Returns the current context.
public getContext ( ) : phpDocumentor\Reflection\DocBlock\Context
Результат phpDocumentor\Reflection\DocBlock\Context

getLocation() публичный Метод

Returns the current location.
public getLocation ( ) : phpDocumentor\Reflection\DocBlock\Location
Результат phpDocumentor\Reflection\DocBlock\Location

getLongDescription() публичный Метод

Returns the full description or also known as long description.
public getLongDescription ( ) : Description
Результат phpDocumentor\Reflection\DocBlock\Description

getShortDescription() публичный Метод

Returns the opening line or also known as short description.
public getShortDescription ( ) : string
Результат string

getTags() публичный Метод

Returns the tags for this DocBlock.
public getTags ( ) : Tag[]
Результат phpDocumentor\Reflection\DocBlock\Tag[]

getTagsByName() публичный Метод

Returns an array of tags matching the given name. If no tags are found an empty array is returned.
public getTagsByName ( string $name ) : Tag[]
$name string String to search by.
Результат phpDocumentor\Reflection\DocBlock\Tag[]

hasTag() публичный Метод

Checks if a tag of a certain type is present in this DocBlock.
public hasTag ( string $name ) : boolean
$name string Tag name to check for.
Результат boolean

parseTags() защищенный Метод

Creates the tag objects.
protected parseTags ( string $tags ) : void
$tags string Tag block to parse.
Результат void

splitDocBlock() защищенный Метод

Splits the DocBlock into a short description, long description and block of tags.
Автор: RichardJ Special thanks to RichardJ for the regex responsible for the split.
protected splitDocBlock ( string $comment ) : string[]
$comment string Comment to split into the sub-parts.
Результат string[] containing the short-, long description and an element containing the tags.

Описание свойств

$context защищенное свойство

Information about the context of this DocBlock.
protected $context

$location защищенное свойство

Information about the location of this DocBlock.
protected $location

$long_description защищенное свойство

The actual description for this docblock.
protected $long_description

$short_description защищенное свойство

The opening line for this docblock.
protected $short_description

$tags защищенное свойство

An array containing all the tags in this docblock; except inline.
protected $tags