Tags
The following tags are already included in PhpDocumentor::tags():
- @api
- @author
- @copyright
- @deprecated
- @example
- @ignore
- @internal
- @link
- @method(all methods will be grouped in- methodsarray)
- @package
- @param(all params will be grouped in- paramsarray)
- @property(all properties will be grouped in- propertiesarray)
- @property-read(also in- propertiesarray)
- @property-write(also in- propertiesarray)
- @return
- @see
- @since
- @throws(all exceptions will be grouped in- throwsarray)
- @todo
- @uses
- @used-by
- @var
So if you only need to parse those tags, you can simply do:
//$doc = ...; Get doc-comment string from reflection
$tags = PhpDocumentor::tags();
$parser = new PhpdocParser($tags);
$meta = $parser->parse($doc);
Tags classes
Here’s a list of available tags classes, that should cover most of the use cases:
- Summery
- ArrayTag
- CustomTag
- DescriptionTag
- ExampleTag
- FlagTag
- MapTag
- MethodTag
- ModifyTag
- MultiTag
- NumberTag
- RegExpTag
- VarTag
- WordTag
The following function is used in tags documentation, for short reference to parsing:
function getNotations(string $doc, array $tags = []) {
    $tags = PhpDocumentor::tags()->add($tags);
    $parser = new PhpdocParser($tags);
    $notations = $parser->parse($doc);
    return $notations;
}