Parses the DocBlock for any structure.

category phpDocumentor
package Reflection
author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Parses the given docblock and populates the member fields.

__construct(string | \Reflector $docblock) 

Parameters

$docblock

string\Reflector

A docblock comment (including asterisks) or reflector supporting the getDocComment method.

Exceptions

\phpDocumentor_Reflection_Exception

Returns the exported information (we should use the export static method BUT this throws an exception at this point).

__toString() : string

Returns

string

Builds a string representation of this object.

export() : string

todo determine the exact format as used by PHP Reflection and implement it.

Returns

string

Returns the full description or also known as long description.

getLongDescription() : \phpDocumentor_Reflection_DocBlock_LongDescription

Returns the opening line or also known as short description.

getShortDescription() : string

Returns

string

Returns the tags for this DocBlock.

getTags() : \phpDocumentor_Reflection_DocBlock_Tags[]

Returns

\phpDocumentor_Reflection_DocBlock_Tags[]

Returns an array of tags matching the given name; if no tags are found an empty array is returned.

getTagsByName(string $name) : \phpDocumentor_Reflection_DocBlock_Tag[]

Parameters

$name

string

String to search by.

Returns

Checks if a tag of a certain type is present in this DocBlock.

hasTag(string $name) : bool

Parameters

$name

string

Tag name to check for.

Returns

bool

Strips the asterisks from the DocBlock comment.

cleanInput(string $comment) : string

Parameters

$comment

string

String containing the comment text.

Returns

string

Creates the tag objects.

parseTags(string $tags) : void

Parameters

$tags

string

Tag block to parse.

Splits the DocBlock into a short description, long description and block of tags.

splitDocBlock(string $comment) : \string[]

author RichardJ Special thanks to RichardJ for the regex responsible for the split/

Parameters

$comment

string

Comment to split into the sub-parts.

Returns

\string[]containing the short-, long description and an element containing the tags.

 Properties

 

The actual description for this docblock.

$long_description : \phpDocumentor_Reflection_DocBlock_LongDescription

 

The opening line for this docblock.

$short_description : string

 

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

$tags : \phpDocumentor_Reflection_DocBlock_Tags[]