TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Extbase\Reflection\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()

TYPO3\CMS\Extbase\Reflection\DocCommentParser::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 TYPO3\CMS\Extbase\Reflection\DocCommentParser\$description.

◆ getTagsValues()

TYPO3\CMS\Extbase\Reflection\DocCommentParser::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 TYPO3\CMS\Extbase\Reflection\DocCommentParser\$tags.

◆ getTagValues()

TYPO3\CMS\Extbase\Reflection\DocCommentParser::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

Definition at line 74 of file DocCommentParser.php.

References TYPO3\CMS\Extbase\Reflection\DocCommentParser\isTaggedWith().

◆ isTaggedWith()

TYPO3\CMS\Extbase\Reflection\DocCommentParser::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 TYPO3\CMS\Extbase\Reflection\DocCommentParser\getTagValues().

◆ parseDocComment()

TYPO3\CMS\Extbase\Reflection\DocCommentParser::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 TYPO3\CMS\Extbase\Reflection\DocCommentParser\parseTag().

◆ parseTag()

TYPO3\CMS\Extbase\Reflection\DocCommentParser::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 TYPO3\CMS\Extbase\Reflection\DocCommentParser\parseDocComment().

Member Data Documentation

◆ $description

TYPO3\CMS\Extbase\Reflection\DocCommentParser::$description = ''
protected

◆ $tags

TYPO3\CMS\Extbase\Reflection\DocCommentParser::$tags = []
protected