Add integration test and example on how to read tags

This commit is contained in:
Mike van Riel
2015-06-24 22:50:12 +02:00
parent 97c3735b32
commit cff8a80680
3 changed files with 50 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
require_once(__DIR__ . '/../vendor/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');