File: 02-interpreting-tags.php

package info (click to toggle)
php-phpdocumentor-reflection-docblock 5.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,416 kB
  • sloc: php: 9,035; xml: 67; makefile: 54
file content (24 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require_once('/usr/share/php/phpDocumentor/Reflection/DocBlock/autoload.php');

use phpDocumentor\Reflection\DocBlockFactory;

$docComment = <<<DOCCOMMENT
/**
 * This is an example of a summary.
 *
 * @see \phpDocumentor\Reflection\DocBlock\StandardTagFactory
 */
DOCCOMMENT;

$factory  = DocBlockFactory::createInstance();
$docblock = $factory->create($docComment);

// You can check if a DocBlock has one or more see tags
$hasSeeTag = $docblock->hasTag('see');

// Or we can get a complete list of all tags
$tags = $docblock->getTags();

// But we can also grab all tags of a specific type, such as `see`
$seeTags = $docblock->getTagsByName('see');