TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
DocCommentParser Class Reference

Public Member Functions

 parseDocComment ($docComment)
 
 getTagsValues ()
 
 getTagValues ($tagName)
 
 isTaggedWith ($tagName)
 
 getDescription ()
 

Protected Member Functions

 parseTag ($line)
 

Protected Attributes

 $description = ''
 
 $tags = []
 

Detailed Description

A little parser which creates tag objects from doc comments

Definition at line 20 of file DocCommentParser.php.

Member Function Documentation

getDescription ( )

Returns the description which has been previously parsed

Returns
string The description which has been parsed

Definition at line 98 of file DocCommentParser.php.

References DocCommentParser\$description.

getTagsValues ( )

Returns the tags which have been previously parsed

Returns
array Array of tag names and their (multiple) values

Definition at line 60 of file DocCommentParser.php.

References DocCommentParser\$tags.

getTagValues (   $tagName)

Returns the values of the specified tag. The doc comment must be parsed with parseDocComment() before tags are available.

Parameters
string$tagNameThe tag name to retrieve the values for
Exceptions
RuntimeException
Returns
array The tag's values

Definition at line 74 of file DocCommentParser.php.

References DocCommentParser\isTaggedWith().

isTaggedWith (   $tagName)

Checks if a tag with the given name exists

Parameters
string$tagNameThe tag name to check for
Returns
bool TRUE the tag exists, otherwise FALSE

Definition at line 88 of file DocCommentParser.php.

Referenced by DocCommentParser\getTagValues().

parseDocComment (   $docComment)

Parses the given doc comment and saves the result (description and tags) in the parser's object. They can be retrieved by the getTags() getTagValues() and getDescription() methods.

Parameters
string$docCommentA doc comment as returned by the reflection getDocComment() method
Returns
void

Definition at line 40 of file DocCommentParser.php.

References DocCommentParser\parseTag().

parseTag (   $line)
protected

Parses a line of a doc comment for a tag and its value. The result is stored in the interal tags array.

Parameters
string$lineA line of a doc comment which starts with an @-sign
Returns
void

Definition at line 110 of file DocCommentParser.php.

Referenced by DocCommentParser\parseDocComment().

Member Data Documentation

$description = ''
protected

Definition at line 25 of file DocCommentParser.php.

Referenced by DocCommentParser\getDescription().

$tags = []
protected

Definition at line 30 of file DocCommentParser.php.

Referenced by DocCommentParser\getTagsValues().