Add example and functional test for reconstituting a DocBlock

This commit is contained in:
Mike van Riel
2015-06-27 16:47:47 +02:00
parent 1b5279c777
commit a6ffa93e28
4 changed files with 62 additions and 9 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
require_once(__DIR__ . '/../vendor/autoload.php');
use phpDocumentor\Reflection\DocBlock\Serializer;
use phpDocumentor\Reflection\DocBlockFactory;
$docComment = <<<DOCCOMMENT
/**
* This is an example of a summary.
*
* And here is an example of the description
* of a DocBlock that can span multiple lines.
*
* @see \phpDocumentor\Reflection\DocBlock\StandardTagFactory
*/
DOCCOMMENT;
$factory = DocBlockFactory::createInstance();
$docblock = $factory->create($docComment);
$serializer = new Serializer();
$reconstitutedDocComment = $serializer->getDocComment($docblock);