DocCommentParser
class DocCommentParser (View source)
A little parser which creates tag objects from doc comments
Properties
protected string | $description | The description as found in the doc comment |
|
protected array | $tags | An array of tag names and their values (multiple values are possible) |
Methods
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.
Returns the tags which have been previously parsed
Returns the values of the specified tag. The doc comment must be parsed with parseDocComment() before tags are available.
Checks if a tag with the given name exists
Returns the description which has been previously parsed
Parses a line of a doc comment for a tag and its value.
Details
void
parseDocComment(string $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.
array
getTagsValues()
Returns the tags which have been previously parsed
array
getTagValues(string $tagName)
Returns the values of the specified tag. The doc comment must be parsed with parseDocComment() before tags are available.
bool
isTaggedWith(string $tagName)
Checks if a tag with the given name exists
string
getDescription()
Returns the description which has been previously parsed
protected void
parseTag(string $line)
Parses a line of a doc comment for a tag and its value.
The result is stored in the internal tags array.