PHP Class phpDocumentor\Reflection\DocBlock

Author: Mike van Riel ([email protected])
Inheritance: implements Reflector
Afficher le fichier Open project: explodybits/hookr-plugin Class Usage Examples

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

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() public méthode

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

appendTag() public méthode

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.
Résultat phpDocumentor\Reflection\DocBlock\Tag The newly added tag.

cleanInput() protected méthode

Strips the asterisks from the DocBlock comment.
protected cleanInput ( string $comment ) : string
$comment string String containing the comment text.
Résultat string

export() public static méthode

Builds a string representation of this object.
public static export ( ) : string
Résultat string

getContext() public méthode

Returns the current context.
public getContext ( ) : phpDocumentor\Reflection\DocBlock\Context
Résultat phpDocumentor\Reflection\DocBlock\Context

getLocation() public méthode

Returns the current location.
public getLocation ( ) : phpDocumentor\Reflection\DocBlock\Location
Résultat phpDocumentor\Reflection\DocBlock\Location

getLongDescription() public méthode

Returns the full description or also known as long description.
public getLongDescription ( ) : Description
Résultat phpDocumentor\Reflection\DocBlock\Description

getShortDescription() public méthode

Returns the opening line or also known as short description.
public getShortDescription ( ) : string
Résultat string

getTags() public méthode

Returns the tags for this DocBlock.
public getTags ( ) : Tag[]
Résultat phpDocumentor\Reflection\DocBlock\Tag[]

getTagsByName() public méthode

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.
Résultat phpDocumentor\Reflection\DocBlock\Tag[]

hasTag() public méthode

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.
Résultat boolean

parseTags() protected méthode

Creates the tag objects.
protected parseTags ( string $tags ) : void
$tags string Tag block to parse.
Résultat void

splitDocBlock() protected méthode

Splits the DocBlock into a short description, long description and block of tags.
Author: 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.
Résultat string[] containing the short-, long description and an element containing the tags.

Property Details

$context protected_oe property

Information about the context of this DocBlock.
protected $context

$location protected_oe property

Information about the location of this DocBlock.
protected $location

$long_description protected_oe property

The actual description for this docblock.
protected $long_description

$short_description protected_oe property

The opening line for this docblock.
protected $short_description

$tags protected_oe property

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