This abstract parser handles the following tags:
Extending classes should implement the getAllowedTags() method to return the tags that they wish to process, ommiting the tags that this base class processes. When one of these tags in encountered, the process<tag_name> method is called on that class. For example, if a parser's getAllowedTags() method returns \@param as one of its tags, the processParam method will be called so that the parser can process such a tag.
The method is passed the tokens that comprise this tag. The tokens array includes the whitespace that exists between the tokens, as seperate tokens. It's up to the method to create a element that implements the DocElement interface, which should be returned. The AbstractDocElement class is a helper class that can be used to handle most of the parsing of the tokens into their individual sub elements. It requires that you construct it with the element previous to the element currently being processed, which can be acquired with the protected $previousElement class member of this class.
[line 75]
The comment element that appears in the doc comment.[line 82]
The string content of the comment.[line 123]
A list of see elements that appear in this doc comment.[line 130]
A list of see elements that appear in this doc comment.[line 170]
The order of tags.[line 89]
The file that the comment exists in.[line 109]
The previous doc element that was processed.null if the current element being processed is the first element in the doc comment.
[line 116]
A list of see elements that appear in this doc comment.[line 137]
A element to represent \@since tags.[line 163]
An array of unknown tags.[line 99]
The word tokens that appear in the comment.Whitespace tokens also appear in this stack, but are separate tokens from words.
PHP_CodeSniffer_CommentParser_AbstractParser __construct(
string
$comment, PHP_CodeSniffer_File
$phpcsFile)
Overridden in child classes as:
array(string getAllowedTags(
)
Each tag should indicate if only one entry of this tag can exist in the comment by specifying true as the array value, or false if more than one is allowed. Each tag should ommit the @ symbol. Only tags other than the standard tags should be returned.
Overridden in child classes as:
CommentElement getComment(
)
SingleElement getDeprecated(
)
Returns null if no element exists in the comment.
int getLine(
int
$tokenPos)
array(SingleElement) getLinks(
)
Returns an empty array if no links are found in the comment.
array(SingleElement) getSees(
)
SingleElement getSince(
)
Returns null if no element exists in the comment.
void parse(
)
DocElement parseComment(
array(string)
$tokens)
DocElement parseDeprecated(
array(string)
$tokens)
SingleElement parseLink(
array(string)
$tokens)
DocElement parseSee(
array(string)
$tokens)
SingleElement parseSince(
array(string)
$tokens)
void parseTag(
string
$tag, int
$start, int
$end)